private Context findPluginContext() { String classId = getIntent().getStringExtra(PluginDispatcher.ACTIVITY_ID_IN_PLUGIN); LogUtil.d("findPluginContext ", classId); @SuppressWarnings("rawtypes") Class clazz = PluginLoader.loadPluginClassById(classId); if (clazz != null) { return PluginLoader.getDefaultPluginContext(clazz); } return null; }
private void loadPluginActivity() { try { String classId = getIntent().getStringExtra(PluginDispatcher.ACTIVITY_ID_IN_PLUGIN); LogUtil.d("classId ", classId); @SuppressWarnings("rawtypes") Class clazz = PluginLoader.loadPluginClassById(classId); activity = (Activity) clazz.newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }