title: Navigator.app.exitApp()/navigator.device.exitApp() crashing with error on 3.0.0 only
body: <p>I was wondering if any of you were aware of, or knew of a solution to this issue. Basically I have this function here:</p>
  
  <pre><code>  function onDeviceReady() {
       document.addEventListener("backbutton", function() {
       if (getObj("btnBack") != null){
                  pui.click("btnBack");
               }
       else{ 
          navigator.device.exitApp();
       }
       }, false);
    }
  </code></pre>
  
  <p>where pui.click() is just something defined on my end. So this function gets called whenever the back button on my android device is pressed; on 2.9 and all versions below if this reaches a point on the app where the btnBack obj is not present, it calls navigator.device.exitApp() (or navigator.app.exitApp() I switched between the two to see if that would fix my issue) and the app closes just fine. Now with 3.0.0 I get the following fatal exception in Eclipse:</p>
  
  <p>08-16 15:23:27.015: E/AndroidRuntime(22715): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@422635a8 is not valid; is your activity running?</p>
  
  <p>Anyone know whats going on here? I grabbed my application with the previous version from the android market and it works just fine with the back button.</p>
  
  <p>Edit:</p>
  
  <p>Still having this issue months later. My activity is unchanged (there is another package being imported here that I did not include but otherwise this is my activity's source:</p>
  
  <pre><code>import android.os.Bundle;
  import org.apache.cordova.*;
  
  public class PUIClient extends CordovaActivity 
  {
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          super.init();
          // Set by &lt;content src="index.html" /&gt; in config.xml
          super.loadUrl(Config.getStartUrl());
          //super.loadUrl("file:///android_asset/www/index.html")
      }
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Here is the logcat screenshot; it loosk like this is being caused by the onMessage call internally. It seems something internally is trying to send that message while the application is closing down. 
  <img src="https://i.stack.imgur.com/XHXJg.png" alt="enter image description here"></p>