Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Back button cordova

I have a cordova app and I captured the backbutton with this code:

document.addEventListener("backbutton", function (e) {
        backPage();
} , false);

backPage() is a function to go back in previous page. Running debug build I see the back page for a moment but then the app goes in pause and the activity disappears. I want that activity doesn't go in pause but it must be visible to the user.

like image 503
asv Avatar asked Mar 05 '26 07:03

asv


1 Answers

I have had the same issue. Just call

navigator.app.overrideButton("backbutton", true);

before registering the backbutton-listener. It should work then.

like image 122
Michael B Avatar answered Mar 06 '26 22:03

Michael B