BitmapFactory.decodeResource(context.getResources(),R.color.xxx)返回值为null

之前在某个功能里一直用的  Bitmap gbp = BitmapFactory.decodeResource(context.getResources(),R.color.xxx );
方法在小米手机上返回值为null,用其他品牌手机对比了一下均无此问题,为了兼容部分牌子手机,现改为如下写法 Bitmap gbp = BitmapFactory.decodeResource(context.getResources(),
R.drawable.xxx)即可    。    
 
 

猜你喜欢

转载自blog.csdn.net/caijinghuacaijinghua/article/details/79424989