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.


BackAndroid.addEventListener('hardwareBackPress', function() { // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here // Typically you would use the navigator here to go to the last state. if (!this.onMainScreen()) { this.goBack(); return true; } return false; });

Methods #

static exitApp(0) #

static addEventListener(eventName, handler) #

static removeEventListener(eventName, handler) #

Вы можете отредактировать перевод на GitHub и создать pull request!