-
public class RequestTrackerA class for tracking, canceling, and restarting in progress, completed, and failed requests.
This class is not thread safe and must be accessed on the main thread.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisPaused
-
Method Summary
Modifier and Type Method Description booleanisPaused()Returns {@code true}if requests are currently paused, and{@code false}otherwise.voidrunRequest(@NonNull() Request request)Starts tracking the given request. booleanclearAndRemove(@Nullable() Request request)Stops tracking the given request, clears, and recycles it, and returns {@code true}if therequest was removed or invalid or{@code false}if the request was not found.voidpauseRequests()Stops any in progress requests. voidpauseAllRequests()Stops any in progress requests and releases bitmaps associated with completed requests. voidresumeRequests()Starts any not yet completed or failed requests. voidclearRequests()Cancels all requests and clears their resources. voidrestartRequests()Restarts failed requests and cancels and restarts in progress requests. StringtoString()-
-
Method Detail
-
isPaused
boolean isPaused()
Returns
{@code true}if requests are currently paused, and{@code false}otherwise.
-
runRequest
void runRequest(@NonNull() Request request)
Starts tracking the given request.
-
clearAndRemove
boolean clearAndRemove(@Nullable() Request request)
Stops tracking the given request, clears, and recycles it, and returns
{@code true}if therequest was removed or invalid or{@code false}if the request was not found.
-
pauseRequests
void pauseRequests()
Stops any in progress requests.
-
pauseAllRequests
void pauseAllRequests()
Stops any in progress requests and releases bitmaps associated with completed requests.
-
resumeRequests
void resumeRequests()
Starts any not yet completed or failed requests.
-
clearRequests
void clearRequests()
Cancels all requests and clears their resources.
After this call requests cannot be restarted.
-
restartRequests
void restartRequests()
Restarts failed requests and cancels and restarts in progress requests.
-
-
-
-