BFInvoker invoker = null;
Class RegisterInvoker = null;
try {
RegisterInvoker = Class.forName(registeredInvokerClass.get(invokerType));
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
if(RegisterInvoker != null)
{
RegisterInvoker.getDeclaredConstructor().setAccessible(true);
invoker = (BFInvoker) RegisterInvoker.newInstance();
}
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return invoker;
android通過註冊的className新建對象
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.