Java tutorial
//package com.java2s; //License from project: Open Source License import java.lang.reflect.InvocationTargetException; public class Main { /** * Creates a new instance of xposed class. * * @param clzOurClass the xposed class * @param objectOriginalClass the instance of the original class * @return */ private static Object createInstanceFromOurClass(Class clzOurClass, Object objectOriginalClass) { Object objectReturn = null; try { objectReturn = clzOurClass.getConstructors()[0].newInstance(objectOriginalClass); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return objectReturn; } }