Created
May 25, 2018 17:59
-
-
Save joseprl89/60751f94e6dbbfd5b04193964188b60b to your computer and use it in GitHub Desktop.
How ViewModelProviders.of works for https://medium.com/@josep.rodriguez/internals-of-android-architecture-components-part-i-the-viewmodel-d893e362a0d9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ViewModelProvider of(@NonNull Fragment fragment) { | |
AndroidViewModelFactory factory = AndroidViewModelFactory.getInstance(checkApplication(checkActivity(fragment))); | |
return new ViewModelProvider(ViewModelStores.of(fragment), factory); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment