Android examples for java.lang.reflect:Class
get Super Class Of Type
//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; } }