Cordova - Back Button




Cordova - Back Button

Handling Back Button

You will usually want to use Android back button for some app functionality like returning to previous screen. To be able to implement your own functionality, you first need to disable exiting the app when the back button is pressed.

document.addEventListener("backbutton", onBackKeyDown, false);  
function onBackKeyDown(e) { 
   e.preventDefault(); 
   alert('Back Button is Pressed!'); 
}

Now when we press the native Android back button, the alert will appear on the screen instead of exiting the app. This is done by using e.preventDefault().

Cordova - Back Button



Frequently Asked Questions

+
Ans: Cordova - Events view more..
+
Ans: Cordova - Storage view more..
+
Ans: Cordova - config.xml File view more..
+
Ans: Cordova - Back Button view more..
+
Ans: Cordova - Plugman view more..
+
Ans: Cordova - Battery Status view more..
+
Ans: Cordova - Camera view more..
+
Ans: Cordova - Contacts view more..
+
Ans: Cordova - Device view more..
+
Ans: Cordova - Accelerometer view more..
+
Ans: Cordova - Device Orientation view more..
+
Ans: Cordova - Dialogs view more..
+
Ans: Cordova - File System view more..
+
Ans: Cordova - File Transfer view more..
+
Ans: Cordova - Geolocation view more..
+
Ans: Cordova - Globalization view more..
+
Ans: Cordova - InAppBrowser view more..
+
Ans: Cordova - Media view more..




Rating - NAN/5
538 views

Advertisements