Android back button stop working


#1

hello.
I am seeing a strange behaviour with my ionic app.
I am using the app and everything works just fine. However at some point the hardware back button does not enable me to go back to previous page.

so I added some console.log to try to see what is going wrong:
$rootScope.$on(’$stateChangeSuccess’, function(event, toState, toParams, fromState, fromParams) {
console.log(“from :” + fromState.name);
console.log(“to :” + toState.name);
var viewHistory = $ionicHistory.viewHistory();
console.log(viewHistory);
var backView = $ionicHistory.backView();
var forwardView = $ionicHistory.forwardView();
});

I made a printScreen of the traces I got when the android back button stop working.
According to the traces I see no reason why the android back button would not “go back to previous page”.

Can someone help me with this issue…

Two more things:

  • I cannot get a scenario where it happens every time: I play with it sometime for 5 or 10 minutes and it just does not work anymore.
  • On the page where the back button does not work, I have a “cancel” button which calls the $ionicHistory.goBack(); and this always works even when the android hardware back button does not.

I really do not get it…

I am using ionic 1.2.4