/** * @des: 經過圖片名字獲取圖片資源id */public Bitmap getRes(String name) { ApplicationInfo appInfo = getApplicationInfo();//獲取包名 int resID = getResources().getIdentifier(name, "drawable", appInfo.packageName); return BitmapFactory.decodeResource(getResources(), resID);}