Class ShadowPausedAsyncTask<Params,Progress,Result>

java.lang.Object
org.robolectric.shadows.ShadowAsyncTask
org.robolectric.shadows.ShadowPausedAsyncTask<Params,Progress,Result>
Direct Known Subclasses:
ShadowAlwaysOnHotwordDetector.ShadowRefreshAvailabilityTask

@Implements(value=android.os.AsyncTask.class, shadowPicker=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.

  • Constructor Details

    • ShadowPausedAsyncTask

      public ShadowPausedAsyncTask()
  • Method Details

    • reset

      @Resetter public static void reset()
    • executeOnExecutor

      @Implementation protected AsyncTask<Params,Progress,Result> executeOnExecutor(Executor exec, Params... params)
    • overrideExecutor

      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