title: App get close when i pressed back button of android while using react native
body: <p>I am new in react native. I have two pages in my app. When i press the back button, i want to open the previous page but when i press the back button, app get close. What can be done to solve this issue ? </p>
  
  <p>My code is : </p>
  
  <pre><code>'use strict';
  
  import React, { Component } from 'react';
  import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Navigator,
    TextInput,
    TouchableHighlight
   } from 'react-native';
  import ToolbarAndroid from 'ToolbarAndroid';
  import ActionButton from 'react-native-action-button';
  import backAndroid from 'react-native-back-android';
  import {hardwareBackPress} from 'react-native-back-android';
  
  class AwesomeProject extends Component {
    renderScene(route, navigator) {
      if(route.name == 'HomePage') {
        return &lt;HomePage navigator={navigator} {...route.passProps}  /&gt;
      }
      if(route.name == 'FormBuilderPage') {
        return &lt;FormBuilderPage navigator={navigator} {...route.passProps}      /&gt;
      }
    } 
  
    render() {
      return (
        &lt;Navigator
          style={{ flex:1 }}
          initialRoute={{ name: 'HomePage' }}
        renderScene={ this.renderScene } /&gt;
      )
    }
  }
  class BackButtonEvent extends React.Component{
    handleHardwareBackPress(){
      if(this.sate.isOpen()){
        this.handleClose();
        return true;
      }
    }
  }
  var HomePage = React.createClass({
    _navigate(name) {
      this.props.navigator.push({
        name: 'FormBuilderPage',
        passProps: {
          name: name
    }
      })
    },
    render() {    
      return (
        &lt;View style={styles.container}&gt;        
          &lt;ToolbarAndroid style = {styles.toolbar}&gt;
            &lt;Text style = {styles.titleText}&gt; Data Collector &lt;/Text&gt;
          &lt;/ToolbarAndroid&gt;
           &lt;ActionButton 
             source = {require('./icon_container/ic_plus_circle_add_new_form.png')} 
             onPress = {this._navigate}   
            &gt;
           &lt;/ActionButton&gt;
         &lt;/View&gt;
      )
    }
  })
  
  var FormBuilderPage = React.createClass({
  
    render() {    
      return (
        &lt;View style={styles.container}&gt;
          &lt;ToolbarAndroid style = {styles.toolbar}&gt;
            &lt;TextInput placeholder = "Text here"/&gt;
          &lt;/ToolbarAndroid&gt;
        &lt;/View&gt;
      )
    }
  })
  
  var styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#F5FCFF',
    },
    toolbar: {
      height: 56,
      backgroundColor: '#3F51B5'
    },
    titleText: {
      color: '#fff',
    }
  });
  
  AppRegistry.registerComponent('AwesomeProject', () =&gt; AwesomeProject);
  </code></pre>