Skip to content

Instantly share code, notes, and snippets.

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