从Class Loader启动活动
|
对于我的应用程序清单,我包括了放在sdcard上的单独apk文件中的活动。我想知道是否可以使用ClassLoader加载在单独的apk文件中找到的活动并启动它们?
编辑:
所以我的代码看起来像这样:
ClassLoader loader = new DexClassLoader(\"/sdcard/myapp.apk\", getApplicationContext().getFilesDir().getAbsolutePath(), null, AppUI.class.getClassLoader());
Class<?> appClass = loader.loadClass(\"com.test.myActivity\");
Intent myIntent = new Intent(getBaseContext(), appClass);
myIntent.setClassName(\"com.test\", \"com.test.myActivity\");
startActivity(myIntent);
没有找到相关结果
已邀请:
1 个回复
磁辫覆氓