get Inner Class from class name - Android java.lang.reflect

Android examples for java.lang.reflect:Inner Class

Description

get Inner Class from class name

Demo Code


//package com.java2s;

public class Main {
    public static Class getInnerClass(String outerClassName,
            String innerClassSimpleName) throws Exception {
        return getClass((new StringBuilder(String.valueOf(outerClassName)))
                .append("$").append(innerClassSimpleName).toString());
    }/*from   w  ww  .  ja  v  a2  s.  c  om*/

    public static Class getClass(String className) throws Exception {
        return Class.forName(className);
    }
}

Related Tutorials