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

fix: hilt viewmodel onCleared not called #212

Conversation

programadorthi
Copy link
Collaborator

@programadorthi programadorthi commented Sep 20, 2023

As reported in #210 Android ViewModel onCleared function has not been called. Now we are forcing to ViewModel be consumed from nearest LifecycleOwner to be "cleared" by it.

How to test:

  1. Run the module samples.android
  2. Enter Hilt Integration
  3. Go to Details Screen clicking on a Item
  4. Go back to the list to see Details Screen ViewModel been cleared
  5. Press back button or close the Hilt Integration Activity to see List Screen View Model been cleared.

PS: people has reported that this pull request solve #155 here

@programadorthi
Copy link
Collaborator Author

Closing this pull request because the complete solution is on #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant