mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(android): do not call exitEvent on activity restart (#9517)
This commit is contained in:
@ -1190,12 +1190,18 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
rootView._tearDownUI(true);
|
||||
}
|
||||
|
||||
// this may happen when the user changes the system theme
|
||||
// In such case, isFinishing() is false (and isChangingConfigurations is true), and the app will start again (onCreate) with a savedInstanceState
|
||||
// as a result, launchEvent will never be called
|
||||
// possible alternative: always fire launchEvent and exitEvent, but pass extra flags to make it clear what kind of launch/destroy is happening
|
||||
if (activity.isFinishing()) {
|
||||
const exitArgs = {
|
||||
eventName: application.exitEvent,
|
||||
object: application.android,
|
||||
android: activity,
|
||||
};
|
||||
application.notify(exitArgs);
|
||||
}
|
||||
} finally {
|
||||
superFunc.call(activity);
|
||||
}
|
||||
|
Reference in New Issue
Block a user