0

I wish to detect while user clicks backbutton in mobile,Please provide me a solution how to catch the event while user clicks back button in mobile.

Sri
  • 121
  • 8

1 Answers1

0

I am making a phonegap app and needed a similar solution so I use this function:

document.addEventListener("deviceready", stopBack, false);
function stopBack() /* Stops user navigating pages using back button on device */{
    document.addEventListener("backbutton", backKeyPressed, false);

    function backKeyPressed() {

        //Do some stuff

    }
}

Hope that this helps

Theo Michail
  • 157
  • 1
  • 1
  • 11