@Implements(value=android.os.AsyncTask.class, shadowPicker=ShadowAsyncTask.Picker.class, isInAndroidSdk=false) public class ShadowPausedAsyncTask<Params,Progress,Result> extends ShadowAsyncTask
A AsyncTask
shadow for LooperMode.Mode.PAUSED
This is beta API, and will likely be renamed/removed in a future Robolectric release.
ShadowAsyncTask.Picker
Constructor and Description |
---|
ShadowPausedAsyncTask() |
Modifier and Type | Method and Description |
---|---|
protected AsyncTask<Params,Progress,Result> |
executeOnExecutor(Executor exec,
Params... params) |
static void |
overrideExecutor(Executor executor)
Globally override the executor used for all AsyncTask#execute* calls.
|
static void |
reset() |
@Resetter public static void reset()
@Implementation protected AsyncTask<Params,Progress,Result> executeOnExecutor(Executor exec, Params... params)
public static void overrideExecutor(Executor executor)
Globally override the executor used for all AsyncTask#execute* calls.
This can be useful if you want to use a more determinstic executor for tests, like PausedExecutorService
or InlineExecutorService
.
Use this API as a last resort. Its recommended instead to use dependency injection to provide a custom executor to AsyncTask#executeOnExecutor.
Beta API, may be removed or changed in a future Robolectric release