Pressing the Back button closes the application on Android

Hi! I am in the process of creating my first Android application based on Framework7. I use WebView technology to display the page. Unfortunately, but when I go to a page and press the back button, the application turns off. Is it possible that after clicking this button the application would not turn off and return to the previous page?

Here you have an answer.

Also of you create an app with f7 cli and Cordova project. Backbutton functionality it’s included

1 Like

Where should I put this script?
document.addEventListener(‘backbutton’, function (e) {
RootScope.f7.views.main.router.back()
})