@abrj wrote:
I am handling back operation from a screen in two places one at the top left corner (back Icon) which is working fine(calls goBack) and another on hardware back button in Android with ionic's registerbackbuttonAction callback (not working fine).When I am putting an alert inside callback it is showing, however, the redirection to specified path is not happening.Instead, app exits?.
Note: (I have used this callback with different functions in some other controllers in other places for showing a popup and exiting app which are working fine,all with priority 1000) .
$scope.goBack = function() { $localStorage.PapersObj = []; //window.history.back(); var subjectId = $localStorage.pathTrace.subjectId; var subjectName = $localStorage.pathTrace.subName; var subTopic = $localStorage.pathTrace.subTopicId; if(subTopic===undefined){ $location.path("/topics_pr/" + subjectId + "/" + subjectName); } }; var deReg = $ionicPlatform.registerBackButtonAction(function(event) { //event.preventDefault(); //alert("iam called"); var subjectId = $localStorage.pathTrace.subjectId; var subjectName = $localStorage.pathTrace.subName; var subTopic = $localStorage.pathTrace.subTopicId; //if(subTopic===undefined){ $location.path("/topics_pr/" + subjectId + "/" + subjectName); //} },1000,"papers"+topicId);
Posts: 3
Participants: 2