Example usage for android.os Parcel readBundle

List of usage examples for android.os Parcel readBundle

Introduction

In this page you can find the example usage for android.os Parcel readBundle.

Prototype

public final Bundle readBundle(ClassLoader loader) 

Source Link

Document

Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects.

Usage

From source file:com.jetradar.multibackstack.BackStackEntry.java

private BackStackEntry(Parcel in) {
    final ClassLoader loader = getClass().getClassLoader();
    fname = in.readString();//from w w w  . j a v a 2  s  .  c  om
    args = in.readBundle(loader);

    switch (in.readInt()) {
    case NO_STATE:
        state = null;
        break;
    case SAVED_STATE:
        state = SavedState.CREATOR.createFromParcel(in);
        break;
    case PARCELABLE_STATE:
        state = in.readParcelable(loader);
        break;
    default:
        throw new IllegalStateException();
    }
}

From source file:com.tigerpenguin.places.model.Geometry.java

public Geometry(Parcel in) {
    location = in.readParcelable(PlaceLocation.class.getClassLoader());
    viewports = new HashMap<String, PlaceLocation>();
    Bundle bundle = in.readBundle(PlaceLocation.class.getClassLoader());
    if (bundle != null) {
        for (String key : bundle.keySet()) {
            viewports.put(key, (PlaceLocation) bundle.getParcelable(key));
        }// w w  w .  j  a va2s .com
    }
}

From source file:org.mozilla.mozstumbler.service.datahandling.StumblerBundle.java

private StumblerBundle(Parcel in) {
    mWifiData = new HashMap<String, ScanResult>();
    mCellData = new HashMap<String, CellInfo>();

    Bundle wifiBundle = in.readBundle(ScanResult.class.getClassLoader());
    Bundle cellBundle = in.readBundle(CellInfo.class.getClassLoader());

    Collection<String> scans = wifiBundle.keySet();
    for (String s : scans) {
        mWifiData.put(s, (ScanResult) wifiBundle.get(s));
    }/*from  w w w  . j av  a 2 s  .  com*/

    Collection<String> cells = cellBundle.keySet();
    for (String c : cells) {
        mCellData.put(c, (CellInfo) cellBundle.get(c));
    }

    mGpsPosition = in.readParcelable(Location.class.getClassLoader());
    mPhoneType = in.readInt();
}

From source file:de.mrapp.android.dialog.datastructure.ViewPagerItem.java

/**
 * Creates a new representation of one item of a view pager.
 *
 * @param source/*from w ww. j av a 2s  .  com*/
 *         The source, the representation should be created from, as an instance of the class
 *         {@link Parcel}. The source may not be null
 */
@SuppressWarnings("unchecked")
private ViewPagerItem(@NonNull final Parcel source) {
    this.title = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
    this.fragmentClass = (Class<? extends Fragment>) source.readSerializable();
    this.arguments = source.readBundle(getClass().getClassLoader());
}

From source file:com.facebook.notifications.internal.asset.AssetManager.java

public AssetManager(@NonNull Parcel parcel) {
    registeredHandlers = new ConcurrentHashMap<>();

    Bundle handlersBundle = parcel.readBundle(getClass().getClassLoader());
    for (String type : handlersBundle.keySet()) {
        registeredHandlers.put(type, (ParcelableAssetHandler) handlersBundle.getParcelable(type));
    }/* w  w  w . j  a v a 2 s.co m*/
}

From source file:de.mrapp.android.preference.activity.PreferenceHeader.java

/**
 * Creates a new navigation item, which categorizes multiple preferences.
 *
 * @param source//from  w  w  w  .  j a  v a 2 s .c  o m
 *         The parcel, the navigation item should be created from, as an instance of the class
 *         {@link Parcel}. The parcel may not be null
 */
@SuppressWarnings("deprecation")
private PreferenceHeader(@NonNull final Parcel source) {
    setTitle(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source));
    setSummary(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source));
    setBreadCrumbTitle(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source));
    setBreadCrumbShortTitle(TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source));
    setIcon(new BitmapDrawable((Bitmap) source.readParcelable(Bitmap.class.getClassLoader())));
    setFragment(source.readString());
    setExtras(source.readBundle(getClass().getClassLoader()));

    if (source.readInt() != 0) {
        setIntent(Intent.CREATOR.createFromParcel(source));
    }
}

From source file:org.y20k.transistor.core.Station.java

protected Station(Parcel in) {
    TITLE = in.readString();/*from  ww w .j a  v  a2s.c  o m*/
    StreamURI = in.readString();
    mStationFetchResults = in.readBundle(Bundle.class.getClassLoader());
    mPlayback = in.readByte() != 0; // true if byte != 0

    _ID = in.readLong();
    UNIQUE_ID = in.readString();
    SUBTITLE = in.readString();
    IMAGE_PATH = in.readString();
    IMAGE_FILE_NAME = in.readString();
    SMALL_IMAGE_FILE_NAME = in.readString();
    CONTENT_TYPE = in.readString();
    DESCRIPTION = in.readString();
    RATING = in.readInt();
    COMMA_SEPARATED_TAGS = in.readString();
    CATEGORY = in.readString();
    MarkdownDescription = in.readString();
    SMALL_IMAGE_PATH = in.readString();
    IS_FAVOURITE = in.readInt();
    THUMP_UP_STATUS = in.readString();

    LogHelper.v(LOG_TAG, "Station re-created from parcel. State of playback is: " + mPlayback);
}