6.0及以下的ResourceNotFound异常.am试图从另一个应用程序访问drawable。在我的ccase中,我想从另一个应用程序中应用主题。例如启动器应用程序。
background-position
try {
String mDrawableName = "icon";
Resources mApk1Resources = manager.getResourcesForApplication(package_name);
int mDrawableResID = mApk1Resources.getIdentifier("icon", "drawable", package_name);
Drawable myDrawable = mApk1Resources.getDrawable(mDrawableResID);
if (myDrawable != null) {
data.add(new DataModel("" + app_name, myDrawable, package_name));
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}