Load Class by full class name - Android java.lang

Android examples for java.lang:Class

Description

Load Class by full class name

Demo Code

import android.content.Context;
import android.content.Intent;
import android.os.Build;

public class Main{


    public static Class getClass(String classname) {
        Class res = null;//from w ww  .j  a v  a 2 s.  co  m
        try {
            res = Class.forName(classname);
        } catch (ClassNotFoundException e) {

        }
        return res;
    }

}

Related Tutorials