Last active
April 7, 2019 16:41
-
-
Save gfreivasc/a346d4bc411ad2c06cb1906db5cc5510 to your computer and use it in GitHub Desktop.
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 FragmentActivity activity, | |
@Nullable Factory factory) { | |
Application application = checkApplication(activity); | |
if (factory == null) { | |
factory = ViewModelProvider.AndroidViewModelFactory.getInstance(application); | |
} | |
return new ViewModelProvider(activity.getViewModelStore(), factory); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment