fix(android): do not call exitEvent on activity restart (#9517)

This commit is contained in:
Eduardo Speroni
2021-08-18 13:09:50 -03:00
committed by GitHub
parent 3a3b505167
commit 2f630dc464

View File

@ -1190,12 +1190,18 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
rootView._tearDownUI(true); rootView._tearDownUI(true);
} }
const exitArgs = { // this may happen when the user changes the system theme
eventName: application.exitEvent, // In such case, isFinishing() is false (and isChangingConfigurations is true), and the app will start again (onCreate) with a savedInstanceState
object: application.android, // as a result, launchEvent will never be called
android: activity, // 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()) {
application.notify(exitArgs); const exitArgs = {
eventName: application.exitEvent,
object: application.android,
android: activity,
};
application.notify(exitArgs);
}
} finally { } finally {
superFunc.call(activity); superFunc.call(activity);
} }