Android examples for android.os:Parcel
write List To 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; final static int NON_SEPARATOR = 0; @SuppressWarnings("unchecked") public static <T extends Parcelable> void writeListToParcel(Parcel out, List<T> collection) { if (collection != null) { out.writeInt(EXIST_SEPARATOR); out.writeParcelableArray((T[]) collection.toArray(), 0); } else {/*from w w w . j ava2s . co m*/ out.writeInt(NON_SEPARATOR); } } }