I am looking for a way to convert PersistableBundle to Bundle in android. Is there any simpler way to do this? They both do not inherit from same class and hence i cannot typecast them.
Edit:
I found this way to copy
public static Bundle getBundleFromPersistableBundle(final PersistableBundle persistableBundle) {
Bundle bundle = new Bundle();
if(persistableBundle == null) {
return null;
}
bundle.putAll(persistableBundle);
return bundle;
}
You can construct a Bundle from a PersistableBundle instance.
See the documentation for this constructor: