imageUtil--

    

/**
* @des: 通过图片名字获取图片资源id
*/
public Bitmap getRes(String name) {
ApplicationInfo appInfo = getApplicationInfo();//获取包名
int resID = getResources().getIdentifier(name, "drawable", appInfo.packageName);
return BitmapFactory.decodeResource(getResources(), resID);
}
原文地址:https://www.cnblogs.com/awkflf11/p/9959404.html