BitmapDrawable drawable = (BitmapDrawable) a.getDrawable(attr);
mIconBitmap = drawable.getBitmap();
//可以换成
mIconBitmap=BitmapFactory.decodeResource(getResources(), a.getResourceId(attr, 0));
mIconBitmap = drawable.getBitmap();
//可以换成
mIconBitmap=BitmapFactory.decodeResource(getResources(), a.getResourceId(attr, 0));
2015-11-07