read Integer Array From Parcel - Android android.os

Android examples for android.os:Parcel

Description

read Integer Array From Parcel

Demo Code


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

public class Main {
    public static int[] readIntegerArrayFromParcel(Parcel in) {
        int size = in.readInt();
        if (size > -1) {
            int[] val = new int[size];
            for (int i = 0; i < val.length; i++) {
                val[i] = in.readInt();
            }//from w w  w  .ja  va2s .  co  m

            return val;
        } else {
            return null;
        }
    }
}

Related Tutorials