通过l PackageManager 获取某个安装包内的资源

 

final PackageManager packageManager = context.getPackageManager(); Resources resources = packageManager.getResourcesForApplication( iconResource.packageName); final int id = resources.getIdentifier(iconResource.resourceName, null, null); icon = resources.getDrawable(id); 

 

你可能感兴趣的:(android)