我是使用的sdk的版本是28的,在模拟器上运行时发现这个bitmap为null.

BitmapFactory.decodeResource(getContext().getResources(), R.mipmap.ic_launcher);获取不到图片问题

 问题在于: 高版本sdk, 多出了一个xml,

BitmapFactory.decodeResource(getContext().getResources(), R.mipmap.ic_launcher);获取不到图片问题

 所以默认找到的是这个xml , 所以解析不出来bitmap, 如果遇到这个问题把图片该个名字就能解决了~~

相关文章:

  • 2021-05-11
  • 2021-10-11
  • 2021-10-25
  • 2021-08-03
  • 2021-12-16
  • 2021-11-09
  • 2021-12-15
  • 2021-08-25
猜你喜欢
  • 2021-12-11
  • 2021-11-21
  • 2021-10-16
  • 2021-09-23
  • 2021-12-21
  • 2021-09-24
  • 2021-10-22
相关资源
相似解决方案