-
Notifications
You must be signed in to change notification settings - Fork 496
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
Sharing state inbetween activities #119
Comments
I would be surprised if you can. |
@jQrgen No, MvRx does not support this out of the box. If you want to build your own system or have a ViewModel on your Application/Dagger graph, you can do that as you see fit. |
So if i use MvRxViewModel for keeping a global state such as the state of a user i should just initiate it in the fragment identified in nav_graph.xml's app:startDestination=""? What do you guys use for approaching this? A viewModel initiated in MainActivity? |
@jQrgen Well if you want it to persist across activities, you can't instantiate it in a Fragment. You can try having one in your dagger/DI graph with a |
Is it possible to share state inbetween activites? I get errors when trying to access a viewmodel in an activity.
The text was updated successfully, but these errors were encountered: