write String Array List To Parcel - Android android.os

Android examples for android.os:Parcel

Description

write String Array List To Parcel

Demo Code


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

import java.util.List;

public class Main {
    public static void writeStringArrayListToParcel(Parcel out,
            List<String> val) {
        if (val != null && val.size() > 0) {
            out.writeInt(val.size());
            for (String it : val) {
                out.writeString(it);// w  ww.jav  a2  s .  c  o  m
            }
        } else {
            out.writeInt(0);
        }
    }
}

Related Tutorials