Package org.robolectric.shadows
Class ShadowAppTask
java.lang.Object
org.robolectric.shadows.ShadowAppTask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidFor tests, marks the task as finished.protected ActivityManager.RecentTaskInfoFor tests, returns theActivityManager.RecentTaskInfoset usingsetTaskInfo(RecentTaskInfo).booleanReturns true if task has been moved to the front.booleanReturns true if task has been excluded from recents.booleanReturns true iffinishAndRemoveTask()has been called before.protected voidFor tests, marks the task as moved to the front.static ActivityManager.AppTaskprotected voidsetExcludeFromRecents(boolean exclude) For tests, marks the task as excluded from recents.voidsetTaskInfo(ActivityManager.RecentTaskInfo recentTaskInfo) Sets the recentTaskInfo for the task.protected voidstartActivity(Context context, Intent intent, Bundle options) Starts the activity using given context.
-
Constructor Details
-
ShadowAppTask
public ShadowAppTask()
-
-
Method Details
-
newInstance
-
finishAndRemoveTask
For tests, marks the task as finished. Task is not finished when created initially.- See Also:
-
getTaskInfo
For tests, returns theActivityManager.RecentTaskInfoset usingsetTaskInfo(RecentTaskInfo). If nothing is set, it returns null.- See Also:
-
moveToFront
For tests, marks the task as moved to the front. Task is created and marked as not moved to the front.- See Also:
-
startActivity
Starts the activity using given context. Started activity can be checked usingShadowContextWrapper.getNextStartedActivity()- Parameters:
context- Context with which the activity will be start.intent- Intent of the activity to be started.options- Extras passed to the activity.
-
setExcludeFromRecents
For tests, marks the task as excluded from recents. Current, status can be checked usingisExcludedFromRecents().- Parameters:
exclude- Whether to exclude from recents.
-
isFinishedAndRemoved
public boolean isFinishedAndRemoved()Returns true iffinishAndRemoveTask()has been called before. -
setTaskInfo
Sets the recentTaskInfo for the task.getTaskInfo()returns the task info set using this method. -
hasMovedToFront
public boolean hasMovedToFront()Returns true if task has been moved to the front.- See Also:
-
isExcludedFromRecents
public boolean isExcludedFromRecents()Returns true if task has been excluded from recents.- See Also:
-