ActivityLifecycles


class ActivityLifecycles


Helper methods to understand ActivityLifecycle of the app.

Summary

Public functions

java-static Boolean

Indicates whether or not an Activity in our app is currently in the foreground.

java-static Boolean

Indicates whether or not an Activity, not in the foreground, exists in our app within the "Visible Lifetime" state.

java-static Boolean

Indicates whether or not an Activity exists in our app within the "Visible Lifetime" state.

Public functions

hasForegroundActivities

java-static fun hasForegroundActivities(monitor: ActivityLifecycleMonitor!): Boolean

Indicates whether or not an Activity in our app is currently in the foreground.

The "Foreground lifetime" of an activity occurs after a call to onResume and before a call to onPause.

During this time, the activity is in front of all other activities and is currently receiving user input.

Parameters
monitor: ActivityLifecycleMonitor!

the ActivityLifecycleMonitor to use.

Returns
Boolean

true if an activity exists in the foreground state.

hasTransitioningActivities

java-static fun hasTransitioningActivities(monitor: ActivityLifecycleMonitor!): Boolean

Indicates whether or not an Activity, not in the foreground, exists in our app within the "Visible Lifetime" state.

The "Visible Lifetime" is defined as an activity where the onStart() method has been called but where the onStop() method has not been called.

During this time, the Activity may be visible to the user, and it may be receiving input from the user. This time is a superset of the "Foreground lifetime" of the activity.

It may be the case that an application has activities in the "visible lifetime" but none in the "Foreground lifetime." It may be the case that without user input an activity will shortly transition into the "Foreground lifetime" in this state, however it also may not transition without further user interaction.

Parameters
monitor: ActivityLifecycleMonitor!

the ActivityLifecycleMonitor to use

Returns
Boolean

true if any activity exists with a transitioning stage.

hasVisibleActivities

java-static fun hasVisibleActivities(monitor: ActivityLifecycleMonitor!): Boolean

Indicates whether or not an Activity exists in our app within the "Visible Lifetime" state.

The "Visible Lifetime" is defined as an activity where the onStart() method has been called but where the onStop() method has not been called.

During this time, the Activity may be visible to the user, and it may be receiving input from the user. This time is a superset of the "Foreground lifetime" of the activity.

It may be the case that an application has activities in the "visible lifetime" but none in the "Foreground lifetime." It may be the case that without user input an activity will shortly transition into the "Foreground lifetime" in this state, however it also may not transition without further user interaction.

Parameters
monitor: ActivityLifecycleMonitor!

the ActivityLifecycleMonitor to use

Returns
Boolean

true if any activity exists within it's foreground lifetime.