ActivityLifecycleWatcher

An Application.ActivityLifecycleCallbacks watcher for testedApplication. This class can be used to wait for the activity recreation after calling a function that triggers a configuration change.

Constructors

Link copied to clipboard
fun ActivityLifecycleWatcher(testedApplication: Application)

Functions

Link copied to clipboard
open override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?)
Link copied to clipboard
open override fun onActivityDestroyed(activity: Activity)
Link copied to clipboard
open override fun onActivityPaused(activity: Activity)
Link copied to clipboard
open override fun onActivityResumed(activity: Activity)
Link copied to clipboard
open override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle)
Link copied to clipboard
open override fun onActivityStarted(activity: Activity)
Link copied to clipboard
open override fun onActivityStopped(activity: Activity)
Link copied to clipboard
fun setAndWaitForOrientationLandscape(setOrientationLandscape: () -> Unit)

Set the orientation to landscape and wait for the activity configuration change to complete. Do nothing, if the orientation is already in landscape.

Link copied to clipboard
fun setAndWaitForOrientationPortrait(setOrientationPortrait: () -> Unit)

Set the orientation to portrait and wait for the activity configuration change to complete. Do nothing, if the orientation is already in portrait.

Link copied to clipboard
fun setAndWaitForResolution(setResolution: () -> Unit)

Set the resolution and wait for the activity configuration change to complete.

Inherited functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard