Skip to content

Instantly share code, notes, and snippets.

@Pluu
Created March 16, 2020 16:15
Show Gist options
  • Save Pluu/e2f1c5c92534288bd430dfbd3f0709b5 to your computer and use it in GitHub Desktop.
Save Pluu/e2f1c5c92534288bd430dfbd3f0709b5 to your computer and use it in GitHub Desktop.
public final class SavedStateHandle {
final Map<String, Object> mRegular;
...
private final SavedStateProvider mSavedStateProvider = new SavedStateProvider() {
@NonNull
public Bundle saveState() {
Set<String> keySet = mRegular.keySet();
ArrayList keys = new ArrayList(keySet.size());
ArrayList value = new ArrayList(keys.size());
...
Bundle res = new Bundle();
res.putParcelableArrayList("keys", keys);
res.putParcelableArrayList("values", value);
return res;
}
};
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment