List of usage examples for android.os PersistableBundle get
@Nullable
public Object get(String key)
From source file:Main.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1) public static Bundle persistableBundleToBundle(PersistableBundle persistableBundle) { Set<String> keySet = persistableBundle.keySet(); Bundle bundle = new Bundle(); for (String key : keySet) { Object value = persistableBundle.get(key); if (value instanceof Boolean) { bundle.putBoolean(key, (boolean) value); } else if (value instanceof Integer) { bundle.putInt(key, (int) value); } else if (value instanceof String) { bundle.putString(key, (String) value); } else if (value instanceof String[]) { bundle.putStringArray(key, (String[]) value); } else if (value instanceof PersistableBundle) { Bundle innerBundle = persistableBundleToBundle((PersistableBundle) value); bundle.putBundle(key, innerBundle); }/*w w w . ja v a2 s .c o m*/ } return bundle; }