Hi,I want to know why my registerBackButtonAction didn't work. . . . >_<

.run(function($ionicPlatform, $ionicPopup, $rootScope, $location) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
  cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
  // org.apache.cordova.statusbar required
  StatusBar.styleDefault();
}
});
$ionicPlatform.registerBackButtonAction(function(){
      alert('why not working....>_<')
    }, 101);
 })

this is myCode,when I click android hardware back button,it can’t alert the info,I don’t know why. hope you can help me, thank you (。・`ω´・)

1 Like