mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Hacking together a work-around for the default back behaviour
This commit is contained in:
@@ -28,6 +28,32 @@ function Device() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* You must explicitly override the back button.
|
||||
*/
|
||||
|
||||
Device.prototype.overrideBackButton = function()
|
||||
{
|
||||
BackButton.override();
|
||||
}
|
||||
|
||||
/*
|
||||
* This resets the back button to the default behaviour
|
||||
*/
|
||||
|
||||
Device.prototype.resetBackButton = function()
|
||||
{
|
||||
BackButton.reset();
|
||||
}
|
||||
|
||||
/*
|
||||
* This terminates the activity!
|
||||
*/
|
||||
Device.prototype.exitApp = function()
|
||||
{
|
||||
BackButton.exitApp();
|
||||
}
|
||||
|
||||
PhoneGap.addConstructor(function() {
|
||||
navigator.device = window.device = new Device();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user