c# - Windows Phone PhoneGap app back button issue -


i developing windows phone phonegap app. when clicking hardware button, going previous page using history.go(-1); when in initial page , click button navigating same page instead of killing application. appreciated.

to configure button can use these functions:

// exit app navigator.app.exitapp();  // hsitory use navigator.app.backhistory() 

complete code :

document.addeventlistener("deviceready", ondeviceready, false);  function ondeviceready(){     document.addeventlistener("backbutton", function(e){        if($.mobile.activepage.is('#home')){            e.preventdefault();            navigator.app.exitapp();        }        else {            navigator.app.backhistory()        }     }, false); } 

Comments