Java tutorial
//package com.java2s; //License from project: Apache License import android.widget.RemoteViews; public class Main { public static Class getRemoteViewsClass(Class<? extends RemoteViews> clazz) { if (clazz.equals(RemoteViews.class)) return clazz; Class superClass = clazz.getSuperclass(); while (!superClass.equals(RemoteViews.class)) { superClass = superClass.getSuperclass(); } return superClass; } }