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

# onBackPressed

`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/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/BrowserToolbar.kt#L396)

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

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.

