mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Merge pull request #3097 from NativeScript/nnikolov/ForeActivityFix
Foreground activity cleared on activity destroyed.
This commit is contained in:
@ -33,6 +33,10 @@ function initLifecycleCallbacks() {
|
||||
},
|
||||
|
||||
onActivityDestroyed: function (activity: any) {
|
||||
if (activity === androidApp.foregroundActivity) {
|
||||
androidApp.foregroundActivity = undefined;
|
||||
}
|
||||
|
||||
if (activity === androidApp.startActivity) {
|
||||
androidApp.startActivity = undefined;
|
||||
}
|
||||
@ -47,10 +51,6 @@ function initLifecycleCallbacks() {
|
||||
},
|
||||
|
||||
onActivityPaused: function (activity: any) {
|
||||
if (activity === androidApp.foregroundActivity) {
|
||||
androidApp.foregroundActivity = undefined;
|
||||
}
|
||||
|
||||
if (activity.isNativeScriptActivity) {
|
||||
androidApp.paused = true;
|
||||
|
||||
|
Reference in New Issue
Block a user