Allow app to move to foreground (Android)

This commit is contained in:
Sebastián Katzer
2017-01-03 22:06:50 +01:00
parent 5bd6b1f0d8
commit a9877ec0a1
2 changed files with 43 additions and 10 deletions

View File

@@ -110,6 +110,17 @@ exports.moveToBackground = function () {
}
};
/**
* Move app to foreground when in background (Android only).
*
* @return [ Void ]
*/
exports.moveToForeground = function () {
if (this.isActive() && device.platform == 'Android') {
cordova.exec(null, null, 'BackgroundMode', 'foreground', []);
}
};
/**
* Override the back button on Android to go to background
* instead of closing the app.