How to load a image from assets?

前端 未结 6 855
傲寒
傲寒 2020-11-29 06:28

i need to load a image from assets to avoid a froyo 2.2.2 bug resizing POT images in some particular cases. The way to avoid it is loading the image files from assets dir.

6条回答
  •  醉话见心
    2020-11-29 07:05

    Here is an alternative way

    setImageBitmap(BitmapFactory.decodeStream(assets.open("photo.jpg")))
    

提交回复
热议问题