May 21, 2021 Cordova
You usually want to
Android
of the application features of the Android return button, such as going back to the last screen.
/b10>
In order to be able to implement your own functionality, you first need to disable exiting the application when you press the return button.
document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown(e) { e.preventDefault(); alert('Back Button is Pressed!'); }
Now, when we press the android back
Android
the alert appears on the screen instead of exiting the app.
/b10>
This is
e.preventDefault()