angularjs - Apache Cordova backbutton event not fired on Windows Phone (universal) -


i've creeated apache cordova project single page application. on start page there list of items. when click on item navigate details page with

window.navigate("#/details/" + id);  

angular.js displays details template when use hardware backbutton on windows phone suspends application instead ov navigating back. tried hook backbutton event

function ondeviceready() {     // handle cordova pause , resume events     document.addeventlistener('pause', onpause.bind(this), false);     document.addeventlistener('resume', onresume.bind(this), false);     document.addeventlistener("backbutton", onbackbutton, false); } 

but event isn't fired when click button. use winjs , tried winjs.application.onbackclick doesn't work.

so how can handle button on windows phone universal?

this looks bug in windows phone runtime target cordova. in silverlight cordovapage.xaml.cs file hooks windows phone backbutton event handling , forwards cordova's backbutton event.

this doesn't happen in runtime version, you'll have add own platform specific handling either handling winjs's onbackclick event or windows.phone.ui.input.hardwarebuttons.backpressed event.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -