Created
May 25, 2018 17:56
-
-
Save joseprl89/cc42e71991864707d588bb7f63a130f3 to your computer and use it in GitHub Desktop.
How ViewModelProviders 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