Files
react-native/website/versioned_docs/0.18/backandroid.md
T
2017-10-27 11:51:58 -07:00

2.8 KiB

id, title, original_id
id title original_id
version-0.18-backandroid backandroid backandroid

BackAndroid

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) #