Created
December 7, 2019 09:50
-
-
Save user-mw/64850d9bafaf2114cd2b7cf999c59470 to your computer and use it in GitHub Desktop.
ViewModelProivder get() 2017
This file contains 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 class ViewModelProvider { | |
DEFAULT_KEY = "android.arch.lifecycle.ViewModelProvider.DefaultKey"; | |
// Code | |
public <T extends ViewModel> T get(Class<T> modelClass) { | |
String canonicalName = modelClass.getCanonicalName(); | |
// Code | |
return get(DEFAULT_KEY + ":" + canonicalName, modelClass); | |
} | |
// Code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment