Code example for Bundle

Methods: putParcelable

0
 
    public static void putObjectInBundle(Bundle bundle, String key, Object value) {
        if (value instanceof String) {
            bundle.putString(key, (String) value);
        } else if (value instanceof Parcelable) {
            bundle.putParcelable(key, (Parcelable) value);
        } else if (value instanceof byte[]) {
            bundle.putByteArray(key, (byte[]) value);
        } else { 
            throw new FacebookException("attempted to add unsupported type to Bundle");
        } 
    } 
 
    public static void closeQuietly(Closeable closeable) {
        try { 
            if (closeable != null) {
                closeable.close();
            } 
        } catch (IOException ioe) {
            // ignore 
        }