Skip to content

Instantly share code, notes, and snippets.

@joseprl89
Created May 25, 2018 17:56
Show Gist options
  • Save joseprl89/31b55460b504db224b17dfdd50778212 to your computer and use it in GitHub Desktop.
Save joseprl89/31b55460b504db224b17dfdd50778212 to your computer and use it in GitHub Desktop.
final void put(String key, ViewModel viewModel) {
ViewModel oldViewModel = mMap.get(key);
if (oldViewModel != null) {
oldViewModel.onCleared();
}
mMap.put(key, viewModel);
}
final ViewModel get(String key) {
return mMap.get(key);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment