|
@@ -62,9 +62,26 @@ class PushedScreen extends Component {
|
62
|
62
|
case 'accept':
|
63
|
63
|
Alert.alert('NavBar', 'Accept button pressed');
|
64
|
64
|
break;
|
|
65
|
+
|
|
66
|
+ case 'backPress':
|
|
67
|
+ this.handleBackPress();
|
|
68
|
+ break;
|
|
69
|
+
|
|
70
|
+ default:
|
|
71
|
+ console.log('PushedScreen', 'Unknown event ' + event.id);
|
65
|
72
|
}
|
66
|
73
|
}
|
67
|
74
|
|
|
75
|
+ handleBackPress() {
|
|
76
|
+ Alert.alert(
|
|
77
|
+ 'Back button press!',
|
|
78
|
+ 'Handling back press in JS',
|
|
79
|
+ [
|
|
80
|
+ {text: 'Pop', onPress: () => this.props.navigator.pop()}
|
|
81
|
+ ]
|
|
82
|
+ )
|
|
83
|
+ }
|
|
84
|
+
|
68
|
85
|
render() {
|
69
|
86
|
return (
|
70
|
87
|
<ScrollView style={{flex: 1, padding: 20, backgroundColor: this.bgColor}}>
|