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. )