OutOfMemory exception when loading bitmap from external storage

前端 未结 13 1708
广开言路
广开言路 2020-11-29 06:52

In my application I load a couple of images from JPEG and PNG files. When I place all those files into assets directory and load it in this way, everything is ok:

         


        
13条回答
  •  温柔的废话
    2020-11-29 07:35

    Try this another way...

    Bitmap bmpOrignal = BitmapFactory.decodeFile("/sdcard/mydata/" + path");
    

提交回复
热议问题