We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f40cac commit e3753a8Copy full SHA for e3753a8
library/src/main/java/com/loopj/android/http/AsyncHttpResponseHandler.java
@@ -320,14 +320,14 @@ protected void sendMessage(Message msg) {
320
*/
321
protected void postRunnable(Runnable runnable) {
322
boolean missingLooper = null == Looper.myLooper();
323
- if (missingLooper) {
324
- Looper.prepare();
325
- }
326
- if (null != runnable) {
327
- handler.post(runnable);
328
329
330
- Looper.loop();
+ if (runnable != null) {
+ if (missingLooper) {
+ // If there is no looper, run on current thread
+ runnable.run();
+ } else {
+ // Otherwise, run on a handler we create
+ handler.post(runnable);
+ }
331
}
332
333
0 commit comments