Example usage for android.os Parcel readParcelableArray

List of usage examples for android.os Parcel readParcelableArray

Introduction

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

Prototype

public final Parcelable[] readParcelableArray(ClassLoader loader) 

Source Link

Document

Read and return a new Parcelable array from the parcel.

Usage

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

public Champion(Parcel in) {
    Field[] declaredFields = Champion.class.getDeclaredFields();
    try {/*  ww  w .j a  va 2 s .co  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.aokyu.dev.pocket.content.Page.java

private Page(Parcel in) {
    super(in.readString());
    mResolvedId = in.readString();//from w  ww .  j  a v a 2s  .c  om
    mGivenUrl = in.readString();
    mResolvedUrl = in.readString();
    mGivenTitle = in.readString();
    mResolvedTitle = in.readString();
    mIsFavorited = (in.readInt() == 1);
    mState = PageState.valueOf(in.readInt());
    mExcerpt = in.readString();
    mIsArticle = (in.readInt() == 1);
    mImageState = ImageState.valueOf(in.readInt());
    mVideoState = VideoState.valueOf(in.readInt());
    mWordCount = in.readInt();
    in.readStringArray(mTags);
    in.readStringArray(mAuthors);
    mImages = (Image[]) in.readParcelableArray(Image.class.getClassLoader());
    mVideos = (Video[]) in.readParcelableArray(Video.class.getClassLoader());
}