read Creator - Android android.os

Android examples for android.os:Parcel

Description

read Creator

Demo Code


//package com.java2s;

import android.os.Parcel;
import android.os.Parcelable;

public class Main {
    public static final <T extends Parcelable> T readCreator(Parcel p,
            Parcelable.Creator<T> creator, ClassLoader loader) {
        if (creator instanceof Parcelable.ClassLoaderCreator<?>) {
            return ((Parcelable.ClassLoaderCreator<T>) creator)
                    .createFromParcel(p, loader);
        }/*w w  w .  ja  v a2  s .  c  o  m*/
        return creator.createFromParcel(p);
    }
}

Related Tutorials