How to create a Drawable from byte[] ? (Android)

前端 未结 2 1340
春和景丽
春和景丽 2020-12-14 18:48

I have an array of bytes and I need to convert it into a Android Drawable. How can I perform this conversion?

Here is what i tried but without success:



        
2条回答
  •  臣服心动
    2020-12-14 19:36

    Do you really need a Drawable ? If Bitmap can fit, then :

    Bitmap bitmap = BitmapFactory.decodeStream(is);
    

提交回复
热议问题