我现在开发2个APP 为: A.apk B.apk这个程序,通过指定:android:sharedUserId="com.xxxx.plugin"
实现在2APP 共用一个uid。我现在想从A.apk 使用B.apk中的资源文件,怎么办,能实现吗?比如:B.apk 中有 raw/comm.xml,我希望A.apk能获取使用。这样,我的comm.xml改变,只要升级B.apk就可以了。
实现在2APP 共用一个uid。我现在想从A.apk 使用B.apk中的资源文件,怎么办,能实现吗?比如:B.apk 中有 raw/comm.xml,我希望A.apk能获取使用。这样,我的comm.xml改变,只要升级B.apk就可以了。
public abstract Resources getResourcesForApplication (String appPackageName)
Context slaveContext = null;
try {
slaveContext = convertView.getContext().createPackageContext(
"com.carnurse.plugin.laws",Context.CONTEXT_IGNORE_SECURITY);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
int resID = slaveContext.getResources().getIdentifier("ic_launcher", "drawable", "com.carnurse.plugin.laws");
holder.ivIcon.setImageDrawable(slaveContext.getResources().getDrawable(resID));