0

I'm making a WebView app for Android, using only HTML/CSS/JS, and i have to change the behaviour of the phone's back button in the navigation bar. (not the browser's back button.) How do i detect when the user clicks the back button of the phone and make my app do something? (WITH JAVASCRIPT.)

Ercan Tomaç
  • 1
  • 1
  • 3
  • 1
    try the suggested answers here - [https://stackoverflow.com/questions/47092384/use-javascript-jquery-detect-android-back-button/47092587](https://stackoverflow.com/questions/47092384/use-javascript-jquery-detect-android-back-button/47092587), [Detect use of Android back button using JavaScript](https://stackoverflow.com/questions/20373849/detect-use-of-android-back-button-using-javascript). – PJA Sep 09 '20 at 13:17
  • "onpopstate" and "onhashchange" events are not working, and the other answer is Java code. – Ercan Tomaç Sep 09 '20 at 13:31

0 Answers0