Example usage for android.os Parcel readArrayList

List of usage examples for android.os Parcel readArrayList

Introduction

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

Prototype

public final ArrayList readArrayList(ClassLoader loader) 

Source Link

Document

Read and return a new ArrayList object from the parcel at the current dataPosition().

Usage

From source file:br.ufrj.ppgi.jemf.mobile.bean.Team.java

@SuppressWarnings("unchecked")
private static ArrayList<AbstractUser> extractedMembers(Parcel in) {
    return in.readArrayList(AbstractUser.class.getClassLoader());
}

From source file:Main.java

@SuppressWarnings("unchecked")
public static List<Parcelable> readParcelableList(Context context, String fileName, ClassLoader classLoader) {
    List<Parcelable> results = null;
    FileInputStream fis = null;/* w  w w  .j a  v  a2  s  .co m*/
    ByteArrayOutputStream bos = null;
    try {
        fis = context.openFileInput(fileName);
        if (fis != null) {
            bos = new ByteArrayOutputStream();
            byte[] b = new byte[4096];
            int bytesRead;
            while ((bytesRead = fis.read(b)) != -1) {
                bos.write(b, 0, bytesRead);
            }

            byte[] data = bos.toByteArray();

            Parcel parcel = Parcel.obtain();
            parcel.unmarshall(data, 0, data.length);
            parcel.setDataPosition(0);
            results = parcel.readArrayList(classLoader);
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
        results = null;
    } finally {
        if (fis != null)
            try {
                fis.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        if (bos != null)
            try {
                bos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
    }

    return results;
}

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

@SuppressWarnings("unchecked")
public OpeningHours(Parcel in) {
    openNow = (in.readInt() == 1);//  w ww  . j a  va 2 s.  c  o  m
    periods = in.readArrayList(Period.class.getClassLoader());
}

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

@SuppressWarnings("unchecked")
public Review(Parcel in) {
    aspectRatings = in.readArrayList(AspectRating.class.getClassLoader());
    authorName = in.readString();/*from   w w w. java  2 s .co m*/
    authorUrl = in.readString();
    language = (Language) in.readSerializable();
    rating = in.readInt();
    text = in.readString();
    submitTime = in.readLong();
}

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

@SuppressWarnings("unchecked")
public AddressComponent(Parcel in) {
    longName = in.readString();/*from   w w w.  j a v  a  2 s.co  m*/
    shortName = in.readString();
    addressTypes = in.readArrayList(PlaceType.class.getClassLoader());
}

From source file:ch.gianulli.trelloapi.TrelloList.java

@SuppressWarnings("unchecked")
public TrelloList(Parcel in) {
    this(in.readString(), (Board) in.readParcelable(null), in.readString(),
            (ArrayList<Card>) in.readArrayList(null));
}

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

@SuppressWarnings("unchecked")
public PlaceDetail(Parcel in) {
    addressComponents = in.readArrayList(AddressComponent.class.getClassLoader());
    formattedAddress = in.readString();//from w  ww.  j a v  a 2s. c o m
    localPhone = in.readString();
    geometry = in.readParcelable(Geometry.class.getClassLoader());
    iconUrl = in.readString();
    placeId = in.readString();
    internationalPhone = in.readString();
    name = in.readString();
    openingHours = in.readParcelable(OpeningHours.class.getClassLoader());
    photos = in.readArrayList(Photo.class.getClassLoader());
    priceLevel = (PriceLevel) in.readSerializable();
    rating = in.readDouble();
    reviews = in.readArrayList(Review.class.getClassLoader());
    types = in.readArrayList(PlaceType.class.getClassLoader());
    googlePlacePageUrl = in.readString();
    utcOffset = in.readInt();
    vicinity = in.readString();
    businessWebsite = in.readString();
}

From source file:it.polimi.spf.shared.model.SPFQuery.java

@SuppressWarnings("unchecked")
private SPFQuery(Parcel in) {
    ClassLoader cl = ((Object) this).getClass().getClassLoader();
    mTags = in.readArrayList(cl);
    mProfileFields = new HashMap<String, String>();
    in.readMap(mProfileFields, cl);/*from  w  w w  .j a  va  2 s . co  m*/
    mApps = in.readArrayList(cl);
}

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

@SuppressWarnings("unchecked")
public Place(Parcel in) {
    placeId = in.readString();// w ww.  j  a  va 2s  .  c om
    name = in.readString();
    vicinity = in.readString();
    formattedAddress = in.readString();
    priceLevel = (PriceLevel) in.readSerializable();
    rating = in.readDouble();
    iconUrl = in.readString();
    types = in.readArrayList(PlaceType.class.getClassLoader());
    geometry = in.readParcelable(Geometry.class.getClassLoader());
    openingHours = in.readParcelable(OpeningHours.class.getClassLoader());
    photos = in.readArrayList(Photo.class.getClassLoader());
}

From source file:com.paranoid.gerrit.objects.JSONCommit.java

public JSONCommit(Parcel parcel) {
    mKind = parcel.readString();//w  w  w. j a v a 2s  .  c o m
    mId = parcel.readString();
    mProject = parcel.readString();
    mBranch = parcel.readString();
    mChangeId = parcel.readString();
    mSubject = parcel.readString();
    mStatus = Status.valueOf(parcel.readString());
    mCreatedDate = parcel.readString();
    mLastUpdatedDate = parcel.readString();
    mIsMergeable = parcel.readByte() == 1;
    mSortKey = parcel.readString();
    mCommitNumber = parcel.readInt();
    mCurrentRevision = parcel.readString();
    mOwnerObject = parcel.readParcelable(CommitterObject.class.getClassLoader());
    mPatchSet = parcel.readParcelable(CommitInfo.class.getClassLoader());
    mFileInfos = parcel.readParcelable(FileInfoList.class.getClassLoader());
    mWebAddress = parcel.readString();
    mReviewers = parcel.readParcelable(ReviewerList.class.getClassLoader());
    mPatchSetNumber = parcel.readInt();
    mMessagesList = parcel.readArrayList(CommitComment.class.getClassLoader());
}