Java tutorial
//package com.java2s; import android.os.Parcel; import android.os.Parcelable; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> readTypedListOrNUll(Parcel parcel, Parcelable.Creator<T> creator) { List<T> result = new ArrayList<>(); parcel.readTypedList(result, creator); if (result.isEmpty()) return null; return result; } }