FileDocCategorySizeDatePackage
BundleUtil.javaAPI DocAndroid 5.1 API792Thu Mar 12 22:22:56 GMT 2015android.support.v4.app

BundleUtil

public class BundleUtil extends Object
hide

Fields Summary
Constructors Summary
Methods Summary
public static android.os.Bundle[]getBundleArrayFromBundle(android.os.Bundle bundle, java.lang.String key)
Get an array of Bundle objects from a parcelable array field in a bundle. Update the bundle to have a typed array so fetches in the future don't need to do an array copy.

        Parcelable[] array = bundle.getParcelableArray(key);
        if (array instanceof Bundle[] || array == null) {
            return (Bundle[]) array;
        }
        Bundle[] typedArray = Arrays.copyOf(array, array.length,
                Bundle[].class);
        bundle.putParcelableArray(key, typedArray);
        return typedArray;