File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
library/src/main/java/com/loopj/android/http Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ public RequestHandle(AsyncHttpRequest request) {
40
40
* thread executing this request should be interrupted in an attempt to stop the request.
41
41
* <p> </p> After this method returns, subsequent calls to isDone() will always return
42
42
* true. Subsequent calls to isCancelled() will always return true if this method returned
43
- * true.
43
+ * true. Subsequent calls to isDone() will return true either if the request got cancelled by
44
+ * this method, or if the request completed normally
44
45
*
45
46
* @param mayInterruptIfRunning true if the thread executing this request should be interrupted;
46
47
* otherwise, in-progress requests are allowed to complete
@@ -57,8 +58,11 @@ public void run() {
57
58
_request .cancel (mayInterruptIfRunning );
58
59
}
59
60
}).start ();
61
+ // Cannot reliably tell if the request got immediately canceled at this point
62
+ // we'll assume it got cancelled
63
+ return true ;
60
64
} else {
61
- _request .cancel (mayInterruptIfRunning );
65
+ return _request .cancel (mayInterruptIfRunning );
62
66
}
63
67
}
64
68
return false ;
You can’t perform that action at this time.
0 commit comments