Reputation: 909
I am creating an Android App UI with PhoneGap and jQuery moble. Although the dialog of jQuery mobile was displayed on HTML, when the back key of the device is pressed, this application will be exited. I would like to close not an application but its dialog. What should I program?
Upvotes: 1
Views: 957
Reputation: 5795
You should listen to backbutton
event and act accordingly. Something like this should work:
document.addEventListener("backbutton", function() {
$('your_dialog_element').dialog('close');
}, false);
Upvotes: 2