Example usage for android.os Parcel readParcelable

List of usage examples for android.os Parcel readParcelable

Introduction

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

Prototype

@SuppressWarnings("unchecked")
public final <T extends Parcelable> T readParcelable(ClassLoader loader) 

Source Link

Document

Read and return a new Parcelable from the parcel.

Usage

From source file:com.jefftharris.passwdsafe.file.PasswdFileUri.java

/** Constructor from parcelable data */
private PasswdFileUri(Parcel source) {
    String str;/*  w w  w  .ja v  a  2 s  .  c o m*/
    itsUri = source.readParcelable(getClass().getClassLoader());
    itsType = Type.valueOf(source.readString());
    str = source.readString();
    //noinspection ConstantConditions
    itsFile = (str != null) ? new File(str) : null;
    itsTitle = source.readString();
    str = source.readString();
    //noinspection ConstantConditions
    itsSyncType = (str != null) ? ProviderType.valueOf(str) : null;
}

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));
    }/*  w ww.jav  a 2  s.  c o m*/

    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:com.android.mail.providers.Attachment.java

public Attachment(Parcel in) {
    name = in.readString();/*from   w  w  w.ja v a2 s . co  m*/
    size = in.readInt();
    uri = in.readParcelable(null);
    contentType = in.readString();
    state = in.readInt();
    destination = in.readInt();
    downloadedSize = in.readInt();
    contentUri = in.readParcelable(null);
    thumbnailUri = in.readParcelable(null);
    previewIntentUri = in.readParcelable(null);
    providerData = in.readString();
    supportsDownloadAgain = in.readInt() == 1;
    type = in.readInt();
    flags = in.readInt();
}

From source file:com.frodo.github.bean.dto.response.Repo.java

protected Repo(Parcel in) {
    super(in);//w ww.  j  a  v a 2 s.  co  m
    this.fork = in.readByte() != 0;
    this.isPrivate = in.readByte() != 0;
    long tmpCreated_at = in.readLong();
    this.created_at = tmpCreated_at == -1 ? null : new Date(tmpCreated_at);
    long tmpPushed_at = in.readLong();
    this.pushed_at = tmpPushed_at == -1 ? null : new Date(tmpPushed_at);
    long tmpUpdated_at = in.readLong();
    this.updated_at = tmpUpdated_at == -1 ? null : new Date(tmpUpdated_at);
    this.forks_count = in.readInt();
    this.id = in.readLong();
    this.parent = in.readParcelable(Repo.class.getClassLoader());
    this.source = in.readParcelable(Repo.class.getClassLoader());
    this.clone_url = in.readString();
    this.description = in.readString();
    this.homepage = in.readString();
    this.forks_url = in.readString();
    this.git_url = in.readString();
    this.contents_url = in.readString();
    this.language = in.readString();
    this.default_branch = in.readString();
    this.mirror_url = in.readString();
    this.name = in.readString();
    this.full_name = in.readString();
    this.ssh_url = in.readString();
    this.svn_url = in.readString();
    this.owner = in.readParcelable(User.class.getClassLoader());
    this.stargazers_count = in.readInt();
    this.subscribers_count = in.readInt();
    this.network_count = in.readInt();
    this.watchers_count = in.readInt();
    this.size = in.readInt();
    this.open_issues_count = in.readInt();
    this.has_issues = in.readByte() != 0;
    this.has_downloads = in.readByte() != 0;
    this.has_wiki = in.readByte() != 0;
    this.permissions = in.readParcelable(Permissions.class.getClassLoader());
    this.license = in.readParcelable(License.class.getClassLoader());
    this.branches = in.createTypedArrayList(Branch.CREATOR);
    this.archive_url = in.readString();
}

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

/**
 * Creates a new navigation item, which categorizes multiple preferences.
 *
 * @param source/*from w  ww. j  a  v  a  2  s.co  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:com.wootric.androidsdk.objects.Settings.java

private Settings(Parcel in) {
    this.firstSurvey = (Long) in.readValue(Long.class.getClassLoader());
    this.userID = (Long) in.readValue(Long.class.getClassLoader());
    this.accountID = (Long) in.readValue(Long.class.getClassLoader());
    this.adminPanelTimeDelay = in.readInt();
    this.localizedTexts = in.readParcelable(LocalizedTexts.class.getClassLoader());
    this.adminPanelCustomMessage = in.readParcelable(WootricCustomMessage.class.getClassLoader());
    this.localCustomMessage = in.readParcelable(WootricCustomMessage.class.getClassLoader());
    this.timeDelay = in.readInt();
    this.surveyImmediately = in.readByte() != 0;
    this.dailyResponseCap = (Integer) in.readValue(Integer.class.getClassLoader());
    this.registeredPercent = (Integer) in.readValue(Integer.class.getClassLoader());
    this.visitorPercent = (Integer) in.readValue(Integer.class.getClassLoader());
    this.resurveyThrottle = (Integer) in.readValue(Integer.class.getClassLoader());
    this.declineResurveyThrottle = (Integer) in.readValue(Integer.class.getClassLoader());
    this.languageCode = in.readString();
    this.productName = in.readString();
    this.recommendTarget = in.readString();
    this.facebookPageId = in.readString();
    this.twitterPage = in.readString();
    this.customThankYou = in.readParcelable(WootricCustomThankYou.class.getClassLoader());
}

From source file:com.scvngr.levelup.core.net.LevelUpResponse.java

/**
 * Constructor for parceling.// w  w  w.ja v  a  2  s  .com
 *
 * @param in the parcel to read from.
 */
public LevelUpResponse(@NonNull final Parcel in) {
    super(in);
    mStatus = LevelUpStatus.valueOf(in.readString());

    mServerErrors = new ArrayList<>();
    in.readTypedList(mServerErrors, Error.CREATOR);
    mServerErrorReadError = (Exception) in.readSerializable();
    mOriginalResponse = in.readParcelable(LevelUpResponse.class.getClassLoader());

    checkRep();
}

From source file:com.vk.sdk.api.model.VKApiVideo.java

/**
 * Creates a Video instance from Parcel.
 *///from  w w w.  j  ava2 s.c o m
public VKApiVideo(Parcel in) {
    this.id = in.readInt();
    this.owner_id = in.readInt();
    this.album_id = in.readInt();
    this.title = in.readString();
    this.description = in.readString();
    this.duration = in.readInt();
    this.link = in.readString();
    this.date = in.readLong();
    this.views = in.readInt();
    this.player = in.readString();
    this.photo_130 = in.readString();
    this.photo_320 = in.readString();
    this.photo_640 = in.readString();
    this.photo = in.readParcelable(VKPhotoSizes.class.getClassLoader());
    this.access_key = in.readString();
    this.comments = in.readInt();
    this.can_comment = in.readByte() != 0;
    this.can_repost = in.readByte() != 0;
    this.user_likes = in.readByte() != 0;
    this.repeat = in.readByte() != 0;
    this.likes = in.readInt();
    this.privacy_view = in.readInt();
    this.privacy_comment = in.readInt();
    this.mp4_240 = in.readString();
    this.mp4_360 = in.readString();
    this.mp4_480 = in.readString();
    this.mp4_720 = in.readString();
    this.external = in.readString();
}

From source file:org.jorge.lolin1.func.champs.models.Champion.java

public Champion(Parcel in) {
    Field[] declaredFields = Champion.class.getDeclaredFields();
    try {//from   w  ww.  ja v a  2s. c o m
        for (Field x : declaredFields) {
            Class<?> thisType = x.getType();
            if (thisType == String.class) {
                x.setAccessible(Boolean.TRUE);
                x.set(this, in.readString());
                x.setAccessible(Boolean.FALSE);
            }
        }
    } catch (IllegalAccessException e) {
        Crashlytics.logException(e);
    }
    tags = in.createStringArray();
    skins = in.createStringArray();
    passive = in.readParcelable(PassiveSpell.class.getClassLoader());
    Parcelable[] parcelableSpells = in.readParcelableArray(ActiveSpell.class.getClassLoader());
    spells = new ActiveSpell[parcelableSpells.length];
    for (int i = 0; i < spells.length; i++) {
        spells[i] = (ActiveSpell) parcelableSpells[i];
    }
}

From source file:com.tdispatch.passenger.model.BookingData.java

private BookingData(Parcel in) {
    setLocalId(in.readLong());//from   www  .  j  a v a2s .  c  o m
    setPk(in.readString());
    setBookingKey(in.readString());
    setDriverPk(in.readString());
    setPickupDate(in.readString());
    setPickupLocation((LocationData) in.readParcelable(LocationData.class.getClassLoader()));
    setDropoffLocation((LocationData) in.readParcelable(LocationData.class.getClassLoader()));
    setPassengerCount(in.readInt());
    setLuggageCount(in.readInt());
    setFlightNumber(in.readString());
    setDistanceKm(in.readDouble());
    setDistanceMiles(in.readDouble());
    setCustomerName(in.readString());
    setCustomerPhone(in.readString());
    setExtraInfo(in.readString());
    setPaymentStatus(in.readString());
    setPaymentMethod(in.readInt());
    setPrepaid((in.readByte() == 1));
    setCost(in.readString());
    setTotalCost(in.readString());
    setCabOfficeName(in.readString());
    setCabOfficeSlug(in.readString());
    setType(in.readInt());
    setReceiptUrl(in.readString());

    setJson(in.readString());

    int wpCount = in.readInt();
    for (int i = 0; i < wpCount; i++) {
        LocationData ld = (LocationData) in.readParcelable(LocationData.class.getClassLoader());
        mWayPoints.add(ld);
    }
}