# BackHandler
You can use BackHandler to detect the presses on the device back button inside of Compose
## Example
```kotlin
--8<-- "activity/backhandler/BackHandlerExample.kt:func"
```
## See also:
* [Official Docs](https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#backhandler)
* [Full Example Code]({{ site.samplefolder }}/activity/backhandler/BackHandlerExample.kt)