简单三行:
Resources res=getResources();
int pic_id = res.getIdentifier(Picname,"drawable",getPackageName());
Bitmap bp = BitmapFactory. decodeResource (res,pic_id);
Picname就是图片名,不需要文件名后缀
标签:res,pic,Picname,Bitmap,drawable,Android,id
来源: https://blog.csdn.net/qq_36491095/article/details/117223234