forked from Github/cordova-plugin-run-in-background
Allow app to override backbutton behaviour
This commit is contained in:
@@ -110,6 +110,16 @@ exports.moveToBackground = function () {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Override the back button on Android to go to background
|
||||
* instead of closing the app.
|
||||
*
|
||||
* @return [ Void ]
|
||||
*/
|
||||
exports.overrideBackButton = function () {
|
||||
document.addEventListener('backbutton', this.moveToBackground, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* If the mode is enabled or disabled.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user