joris

Phonegap

Feb 23rd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onLoad(){
  2.         document.addEventListener('deviceready', function() {
  3.             document.addEventListener("backbutton", ShowExitDialog, false);
  4.         }, false);
  5.     }
  6.    
  7. function ShowExitDialog() {
  8.     navigator.notification.confirm(
  9.         ("Are you sure you want to exit ?"),
  10.         alertexit,
  11.         'Exit',
  12.         'Ya,Tidak'
  13.     );
  14. }
  15.  
  16. function alertexit(button){
  17.     if(button=="1" || button==1){
  18.         device.exitApp();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment