mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Foreground activity cleared on activity destroyed.
This commit is contained in:
@@ -33,6 +33,10 @@ function initLifecycleCallbacks() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onActivityDestroyed: function (activity: any) {
|
onActivityDestroyed: function (activity: any) {
|
||||||
|
if (activity === androidApp.foregroundActivity) {
|
||||||
|
androidApp.foregroundActivity = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
if (activity === androidApp.startActivity) {
|
if (activity === androidApp.startActivity) {
|
||||||
androidApp.startActivity = undefined;
|
androidApp.startActivity = undefined;
|
||||||
}
|
}
|
||||||
@@ -47,10 +51,6 @@ function initLifecycleCallbacks() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onActivityPaused: function (activity: any) {
|
onActivityPaused: function (activity: any) {
|
||||||
if (activity === androidApp.foregroundActivity) {
|
|
||||||
androidApp.foregroundActivity = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activity.isNativeScriptActivity) {
|
if (activity.isNativeScriptActivity) {
|
||||||
androidApp.paused = true;
|
androidApp.paused = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user