is class implementing Parcelable - Android Android OS

Android examples for Android OS:Parcel

Description

is class implementing Parcelable

Demo Code


import java.io.Serializable;
import java.lang.reflect.Field;
import android.os.Bundle;
import android.os.Parcelable;

public class Main{
    /*ww  w . jav  a2s  .  co m*/
    private static boolean isImplementParcelable(Class clazz) {
        Class[] interfaces = clazz.getInterfaces();
        if (interfaces.length == 0) {
            return false;
        }
        for (Class i : interfaces) {
            if (i == Parcelable.class) {
                return true;
            }
        }
        return false;
    }
}

Related Tutorials