write Integer Array List To Parcel - Android android.os

Android examples for android.os:Parcel

Description

write Integer Array List To Parcel

Demo Code


//package com.java2s;
import android.os.Parcel;

import java.util.List;

public class Main {
    public static void writeIntegerArrayListToParcel(Parcel out,
            List<Integer> val) {
        if (val != null && val.size() > 0) {
            out.writeInt(val.size());
            for (Integer it : val) {
                out.writeInt(it);/* w  w w  .ja  v a 2s .c  o m*/
            }
        } else {
            out.writeInt(0);
        }
    }
}

Related Tutorials