I have two pages - home and form. In the editor I navigate to the form page, then in Events section I select form page and from Events I select Backbutton and in Action I choose - Navigate to page.
Also I have second Event attached to this form, which is Device Ready and there I execute Javascript, which opens inAppBrowser and keep reference to add handlers for loadstop and exit.
In home page I have one Listener to the button which navigates me on the form page
Then I compile .apk and install to a device. I click my created button which navigates me to from page and form page launch inAppBrowser , then I close inAppBrowser with phone backButton and I navigate back to home page. When I try to click against phone back button on my home page there seems no action, but I espect to exit application.
I resolve my problem using this workaraund
var pagePathName= window.location.pathname;
var page = pagePathName.substring(pagePathName.lastIndexOf("/") + 1);
if(page == "Home.html") {
navigator.app.exitApp();
} else {
Apperyio.navigateTo("Home", {});
}