File tree 1 file changed +7
-7
lines changed
library/src/main/java/com/loopj/android/http
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -142,17 +142,17 @@ public boolean getUseSynchronousMode() {
142
142
143
143
@ Override
144
144
public void setUseSynchronousMode (boolean value ) {
145
- // Test that a looper has been prepared prior to setting asynchronous mode.
146
- if (value && null == Looper .myLooper ()) {
147
- value = false ;
148
- Log .i (LOG_TAG , "Current thread has not called Looper.prepare(). Forcing synchronous mode." );
145
+ // A looper must be prepared before setting asynchronous mode.
146
+ if (! value && Looper .myLooper () == null ) {
147
+ value = true ;
148
+ Log .w (LOG_TAG , "Current thread has not called Looper.prepare(). Forcing synchronous mode." );
149
149
}
150
150
151
- // If using asynchronous mode.
152
- if (value && handler == null ) {
151
+ // If using synchronous mode.
152
+ if (! value && handler == null ) {
153
153
// Create a handler on current thread to submit tasks
154
154
handler = new ResponderHandler (this );
155
- } else if (! value && handler != null ) {
155
+ } else if (value && handler != null ) {
156
156
// TODO: Consider adding a flag to remove all queued messages.
157
157
handler = null ;
158
158
}
You can’t perform that action at this time.
0 commit comments