Skip to content

Commit

Permalink
Added documentation for customizing fragment lifecycle breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
ILikeYourHat committed Oct 23, 2022
1 parent ffb76fc commit 9c22a2c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/platforms/android/configuration/integrations/fragment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ SentryAndroid.init(this) { options ->
}
```

You can also configure which fragment lifecycle events will be added as breadcrumbs.

```kotlin
import android.app.Application
import io.sentry.android.core.SentryAndroid
import io.sentry.android.fragment.FragmentLifecycleIntegration
import io.sentry.android.fragment.FragmentLifecycleState.CREATED
import io.sentry.android.fragment.FragmentLifecycleState.DESTROYED

SentryAndroid.init(this) { options ->
options.addIntegration(
FragmentLifecycleIntegration(
this,
filterFragmentLifecycleBreadcrumbs = setOf(FragmentLifecycleState.CREATED, FragmentLifecycleState.DESTROYED)
)
)
}
```

## Verify

Create a new `Fragment` view and add a button to it.
Expand Down

0 comments on commit 9c22a2c

Please sign in to comment.