try { String className = 'com.almondmendoza.library.openActivity'; Intent openNewIntent = new Intent( this, Class.forName( className ) ); startActivity( openNewIntent ); } catch (ClassNotFoundException e) { e.printStackTrace(); }
Explanation
Here we use reflections and just convert our class name to a class object.
If you are interested in reflection we had blogged about it previously Access internal classes in Android and Calling Private Methods in Android