title: Android Phonegap App - Close & stop app on exit
body: <p>Is it possible to stop an app on exit?  I have the following code within Phonegap to monitor back button clicks and I would like it to stop the app when exiting - if possible?</p>
  
  <pre><code>document.addEventListener("backbutton", backKeyDown, true); 
  
  
  function backKeyDown() { 
  
      if($.mobile.activePage.is('#homepage')){
        setTimeout( function() {navigator.app.exitApp();}, 100 );
  
      }
      else {
          setTimeout( function() {$.mobile.changePage("#homepage");}, 100 );
  
      }
  }
  </code></pre>
  
  <p>Cheers
  Paul</p>