angularjs - Android hardware back button action never fires (Ionic) -


i tried adding function override current button behaviour, same pressing button (left arrow) in browser. goes view forward instead of going back. understand how webview handle button action if not override.

i surprised android button doesn't work same ion-nav-view standard button, found code responsible in ionic.bundle.js:

  // triggered when devices hardware button (android) clicked user   // cordova/phonegap platform specifc method   function onhardwarebackbutton(e) {     console.log('check'); //this never fires     var backview = $ionichistory.backview();     if (backview) {       // there view, go       backview.go();     } else {       // there no view, close app instead       ionic.platform.exitapp();     }     e.preventdefault();     return false;   }   console.log('check2'); //this fires   $ionicplatform.registerbackbuttonaction(     onhardwarebackbutton,     ionic_back_priority.view   ); 

i tested on galaxy s5.

any hints how make work?

why not using : $ionichistory.goback() instead of backview.go(); ?

from doc goback way navigate through history


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -