Skip to content

Instantly share code, notes, and snippets.

@Pluu
Last active March 16, 2020 16:13
Show Gist options
  • Save Pluu/3d957092c9bf8d554ae02a3789d50c79 to your computer and use it in GitHub Desktop.
Save Pluu/3d957092c9bf8d554ae02a3789d50c79 to your computer and use it in GitHub Desktop.
@NonNull
@Override
public ViewModelProvider.Factory getDefaultViewModelProviderFactory() {
...
mDefaultFactory = new SavedStateViewModelFactory(
getApplication(),
this,
getIntent() != null ? getIntent().getExtras() : null); // ◀ Activityに渡されたArgumentを代入
...
return mDefaultFactory;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment