Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pending lifecycle events hooks #7225

Merged
merged 1 commit into from May 17, 2022
Merged

Added pending lifecycle events hooks #7225

merged 1 commit into from May 17, 2022

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Added pending lifecycle events hooks.

@jsuarezruiz jsuarezruiz added the area/lifecycle 🔁 XPlat and Native UIApplicationDelegate/Activity/Window lifecycle events label May 16, 2022
@rmarinho rmarinho requested a review from mattleibow May 16, 2022 15:30
{
base.OnDestroy();

MauiApplication.Current?.Services?.InvokeLifecycleEvents<AndroidLifecycle.OnDestroy>(del => del(this));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note from the google docs:
https://developer.android.com/reference/android/app/Activity#onDestroy()

Note: do not count on this method being called as a place for saving data! For example, if an activity is editing data in a content provider, those edits should be committed in either onPause() or onSaveInstanceState(Bundle), not here. This method is usually implemented to free resources like threads that are associated with an activity, so that a destroyed activity does not leave such things around while the rest of its application is still running. There are situations where the system will simply kill the activity's hosting process without calling this method (or any others) in it, so it should not be used to do things that are intended to remain around after the process goes away.

@rmarinho rmarinho merged commit a6c12a1 into main May 17, 2022
@rmarinho rmarinho deleted the fix-6993 branch May 17, 2022 13:13
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/lifecycle 🔁 XPlat and Native UIApplicationDelegate/Activity/Window lifecycle events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants