asysbang
标题:
动态加载资源
[打印本页]
作者:
admin
时间:
2019-11-22 10:06
标题:
动态加载资源
AssetManager assetManager = AssetManager.class.newInstance();
AssetManager.class.getDeclaredMethod("addAssetPath", String.class).invoke( assetManager, apkPath);
new Resources(assetManager, context.getResources().getDisplayMetrics(), context.getResources().getConfiguration())
Resources resources=AssertsDexLoader.getResource(getApplicationContext(),dexPath);
Drawable drawable=resources.getDrawable(resources.getIdentifier("bd_logo1","drawable","com.xingen.plugin"));
欢迎光临 asysbang (http://asysbang.com/)
Powered by Discuz! X2.5