Skip to main content

Screen Lifecycle Instrumentation

Generates: Spans

Automatically tracks Activity and Fragment lifecycle transitions, time spent on each screen, and app startup.

Configuration

Enabled by default. To disable:

PulseSDK.INSTANCE.initialize(
application = this,

apiKey = "your-api-key",
dataCollectionState = PulseDataCollectionConsent.ALLOWED,
) {
activity { enabled(false) }
fragment { enabled(false) } // Disable if not using fragments
}
note

App startup tracking (AppStart span) is powered by the activity instrumentation. Disabling activity { } will also disable app startup signals.

What Gets Tracked

App Startup

  • Span Name: AppStart
  • pulse.type: app_start (cold starts only)
  • start.type: cold, warm, or hot

Activity / Fragment Lifecycle

  • Span Names: Created, Resumed, Paused, Stopped, Destroyed
  • pulse.type: screen_load (on Created spans)

Screen Sessions

  • Span Name: ActivitySession / FragmentSession
  • pulse.type: screen_session
  • Measures total time a user spends on a screen

Attributes

AttributeDescriptionAlways Present
pulse.typeapp_start, screen_load, or screen_session
activity.nameActivity class name⚠️ Activity spans only
fragment.nameFragment class name⚠️ Fragment spans only
screen.nameShort screen name
last.screen.namePrevious screen⚠️ Resumed spans only
start.typeCold / warm / hot⚠️ AppStart only