title: How to fully exit Android application in Phonegap?
body: <p>The application successfully exists, but it still stays in the background as active app? How to fully exit?</p>
  
  <p>This is my code:</p>
  
  <pre><code>function showExitDialog() {
  navigator.notification.confirm(
      ("Do you want to Exit?"), // message
      alertexit, // callback
      'Exit the application?', // title
      'YES,NO' // buttonName
  );
  }
  
  
  function alertexit(button){
  
       if(button=="1" || button==1 &amp;&amp; navigator.app) {
           navigator.app.exitApp();
       } else if(button=="1" || button==1 &amp;&amp; navigator.device) {
           navigator.device.exitApp();
       }
  }
  </code></pre>