detect back button in android

 $(window).on(“navigate”, function (event, data) {

  var direction = data.state.direction;
if (direction == 'back') {
// do something
}
if (direction == 'forward') {
// do something else
}
});

Leave a Comment

Your email address will not be published. Required fields are marked *