load Class without Throwing exception - Android java.lang.reflect

Android examples for java.lang.reflect:Class

Description

load Class without Throwing exception

Demo Code


//package com.java2s;

public class Main {
    public static Class<?> loadClassNoThrow(ClassLoader loader, String name) {
        try {/*w  ww.j  a  v  a  2s . c  o  m*/
            return loader.loadClass(name);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related Tutorials