1.安卓back键的处理主要就是一个事件监听
BackAndroid.addEventListener('hardwareBackPress', this.onBackPressed);
BackAndroid.removeEventListener('hardwareBackPress', this.onBackPressed);
componentWillMount() {
if (Platform.OS == = 'android') {
BackAndroid.addEventListener('hardwareBackPress', this.onBackAndroid);
}
}
componentWillUnmount() {
if (Platform.OS == = 'android') {
BackAndroid.removeEventListener('hardwareBackPress', this.onBackAndroid);
}
}