# Screen events
User.com SDK can automatically tracks user activity across the App. Events are related to your app lifecycle, e.g. orientation changes, open/close application, switching between activities(going through one to another mobile screen).
The following screen events are available to be sent:
- activity created
- activity started (with intent arguments)
- activity stopped
- fragment created
- fragment started (with arguments)
- fragment stopped
# Automatic Screen tracking
To automatically track Screen Events add this method with true
argument to UserCom.Builder()
:
- Kotlin
- Java
trackAllActivities(true)
# Manual Screen tracking
To track navigation manually, use:
- Kotlin
- Java
UserCom.getInstance().trackScreen("Screen name")
Passing name
argument allows to track screen navigation effectively for Jetpack Compose Composables
, Fragments
and Activities
.
For Fragments and FragmentActivities, you can also pass this
as an argument which will automatically register screen name as ClassName.
- Kotlin
- Java
class MainActivity : FragmentActivity() {
override fun onCreate() {
super.onCreate()
UserCom.getInstance().trackScreen(this)
}
}
This way lifecycle(created, started, stopped) will be tracked as well.