write Integer Array To Parcel - Android android.os

Android examples for android.os:Parcel

Description

write Integer Array To Parcel

Demo Code


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

public class Main {
    public static void writeIntegerArrayToParcel(Parcel out, int[] val) {
        if (val != null) {
            out.writeInt(val.length);
            for (int i = 0; i < val.length; i++) {
                out.writeInt(val[i]);
            }/*from   w  ww.  j a v a 2 s.c  o m*/
        } else {
            out.writeInt(-1);
        }
    }
}

Related Tutorials