Skip to content

Commit

Permalink
Handle hardware backpress
Browse files Browse the repository at this point in the history
  • Loading branch information
7kfpun committed Mar 26, 2016
1 parent ce1afb2 commit 4fbff04
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions index.android.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';

import {AppRegistry} from 'react-native';
import {
AppRegistry,
BackAndroid,
} from 'react-native';
import Finance from './Finance';

import { Actions } from 'react-native-router-flux';

BackAndroid.addEventListener('hardwareBackPress', () => {
try {
Actions.pop();
return true;
} catch (err) {
return false;
}
});

AppRegistry.registerComponent('Finance', () => Finance);

0 comments on commit 4fbff04

Please sign in to comment.