Skip to content

Commit 9ca7d6c

Browse files
committed
add makeNewPluginContext method
Signed-off-by: Cai Liming <405977146@163.com>
1 parent 8f7c783 commit 9ca7d6c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

PluginCore/src/com/plugin/core/PluginLoader.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ public static Context getPluginContext(@SuppressWarnings("rawtypes") Class clazz
182182
return pluginContext;
183183

184184
}
185+
186+
public static Context getNewPluginContext(@SuppressWarnings("rawtypes") Class clazz) {
187+
188+
Context pluginContext = getPluginContext(clazz);
189+
190+
if (pluginContext != null) {
191+
pluginContext = PluginCreator.createPluginApplicationContext(sApplication,
192+
pluginContext.getResources(), (DexClassLoader)pluginContext.getClassLoader());
193+
}
194+
195+
return pluginContext;
196+
}
185197

186198
/**
187199
* 构造插件信息

0 commit comments

Comments
 (0)