Navigator.app.exitApp()/navigator.device.exitApp() crashing with error on 3.0.0 only

328 views
Skip to first unread message

Antonio Ruballos

unread,
Aug 16, 2013, 6:25:19 PM8/16/13
to phon...@googlegroups.com
Hello everyone,

I was wondering if any of you were aware of, or knew of a solution to this issue. Basically I have this function here:

            function onDeviceReady() {
  document.addEventListener("backbutton", function() {
    if (getObj("btnBack") != null) pui.click("btnBack");
    else{ 
      navigator.device.exitApp();
    }
   }, false);
    }

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:

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?

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.
 
(Bah this new version has been a pain to get going correctly. )

Ronald K

unread,
Aug 19, 2013, 1:51:40 PM8/19/13
to phon...@googlegroups.com
FWIW, I have a 3.0.0 app closing just fine with navigator.app.exitApp(). 

Op zaterdag 17 augustus 2013 00:25:19 UTC+2 schreef Antonio Ruballos:
Message has been deleted

Antonio Ruballos

unread,
Mar 13, 2014, 8:25:31 PM3/13/14
to phon...@googlegroups.com
Ronald,

I finally got this fixed; see here

http://stackoverflow.com/questions/18283068/navigator-app-exitapp-navigator-device-exitapp-crashing-with-error-on-3-0-0/22393797#22393797

Although it sounds like you did not have an issue with this in the first place but I thought you might be interested.
Reply all
Reply to author
Forward
0 new messages