mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +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) {
|
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