[android-components](../../index.md) / [mozilla.components.concept.toolbar](../index.md) / [Toolbar](index.md) / [onBackPressed](./on-back-pressed.md)

# onBackPressed

`abstract fun onBackPressed(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/concept/toolbar/src/main/java/mozilla/components/concept/toolbar/Toolbar.kt#L64)

Should be called by an activity when the user pressed the back key of the device.

**Return**
Returns true if the back press event was handled and should not be propagated further.

