How to trigger an event from native android code on hardware back keypress which will notify Webview.
once the event is triggered, I will handle it in javascript like below.
document.addEventListener("backbutton", function(e){
//callback
}
you may get the anwser from the code in cordova
here is the docs https://cordova.apache.org/docs/en/latest/cordova/events/events.html