0

Experts,
I've been searching all day for this, but I could not find one!
Is it possible to trigger android back button programmatically using javascript/jquery (other than cordova) ? Currently I am developing a cross-platform application that is not cordova-capable on this particular page. Thus, I am relying on javascript/jquery only.

6
  • Are you using webview? Commented Apr 21, 2015 at 6:47
  • @WaqarKhan i am.. its html5 based Commented Apr 21, 2015 at 6:53
  • First you have to Override onBackPressed(). Then you have to implement JavaScriptInterface in your activity. And call the onBackPressed() method from JavaScriptInterface This is well descirbed here Commented Apr 21, 2015 at 7:00
  • @WaqarKhan Thanks! but i dont have control to that android activity class. Instead, i am now on an HTML page without cordova capabilities. I am looking for javascript or jquery to accomplish this. Commented Apr 21, 2015 at 7:29
  • Can you share some code? Commented Apr 21, 2015 at 7:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.