ActivityManager

interface ActivityManager

Shared utility class for monitoring the current lifecycle state of a running application.

This class should provide all Tealium instances with the current application status in terms of whether it is currently foreground or backgrounded. In addition, it should provide information enough to calculate the lifecycle metrics produced by the Lifecycle module.

Types

Link copied to clipboard

Possible types of activity behaviour, which align with the possible events triggered by the android.app.Application.ActivityLifecycleCallbacks

Link copied to clipboard
data class ActivityStatus(val type: ActivityManager.ActivityLifecycleType, val activity: Activity, val timestamp: Long = getTimestampMilliseconds())

This class allows for activity events to be published as a Flow which can therefore be observed.

Link copied to clipboard
sealed class ApplicationStatus

Possible states for the application status. The application should only be in Init state before an activity is on show. After which point, the only possible states should be Foregrounded or Backgrounded

Properties

Link copied to clipboard

An Observable of all activity updates - this property will buffer the ActivityStatus updates for a while to ensure all Activities are captured (required to maintain correct foregrounding/backgrounding calculation) but also for possible AutoTracking that will need a reference to actual Activity instance.

Link copied to clipboard

The current and future application status. This will initially be set to ApplicationStatus.Init until an activity is launched