Your application includes both wireframe classes such as ArrayList and Activity, and application classes such as FlashlightActivity. Framework classes are loaded by the system class loader (as well as the bootstrap loadeR class); application classes are loaded by the application class loader.
A system class loader can only see system classes. It does not know the path of the application class and cannot be used to load application classes. For this you need to use the application class loader. The easiest way to get the link to the application class loader is through the application class:
try { String qual = MultiUserChat.class.getName(); MyActivity.class.getClassLoader().loadClass(qual); } catch (ClassNotFoundException e) { e.printStackTrace(); }
source share