1.新建assets目录

关于AndroidStudio assets目录的一些坑

2.在Activity中加载assets目录中的图片资源到bitmap

InputStream inputStream= null;
try {
    inputStream = getAssets().open("timg.jpg");
} catch (IOException e) {
    e.printStackTrace();
}
bitmap= BitmapFactory.decodeStream(inputStream);

相关文章:

  • 2021-09-17
  • 2021-06-09
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-07
  • 2021-09-01
  • 2021-06-02
  • 2022-12-23
  • 2021-05-24
  • 2021-07-30
相关资源
相似解决方案