Files
react-native/website/_versioned_docs/version-0.22/backandroid.md
T
2017-11-14 12:51:44 -08:00

3.2 KiB

id, original_id, title
id original_id title
version-0.22-backandroid backandroid backandroid

BackAndroid #

Edit on GitHub

Detect hardware back button presses, and programmatically invoke the default back button functionality to exit the app if there are no listeners or if none of the listeners return true.

Example:

BackAndroid.addEventListener('hardwareBackPress', function() { if (!this.onMainScreen()) { this.goBack(); return true; } return false; });

Methods #

static exitApp() #

static addEventListener(eventName: BackPressEventName, handler: Function) #

static removeEventListener(eventName: BackPressEventName, handler: Function) #