get Super Class Of Type - Android java.lang.reflect

Android examples for java.lang.reflect:Class

Description

get Super Class Of Type

Demo Code


//package com.java2s;

import android.util.Log;

public class Main {
    public static Class getSuperClassOfType(Class clazz,
            String superClassName) {
        Class tempClass = clazz;/*from w w w . j ava 2 s. c  om*/
        while (tempClass != null
                && !tempClass.getName().equals(superClassName))
            tempClass = tempClass.getSuperclass();

        Log.i("Recorder", tempClass == null ? "null" : tempClass.getName());

        return tempClass;
    }
}

Related Tutorials