Android examples for android.os:Parcel
read List From Parcel
//package com.java2s; import android.os.Parcel; import android.os.Parcelable; import java.util.List; public class Main { final static int EXIST_SEPARATOR = 1; @SuppressWarnings("unchecked") public static <T extends Parcelable> List<T> readListFromParcel( Parcel in, Class<T> cls) { int flag = in.readInt(); if (flag == EXIST_SEPARATOR) { return in.readArrayList(cls.getClassLoader()); } else {/*from w w w .j a v a 2s .c o m*/ return null; } } }