How to load image through byte array using Glide?

前端 未结 5 1433
抹茶落季
抹茶落季 2020-12-08 13:46

I have an image contents byte[] form. But when i load them through Glide then broken images are shown. what I\'m doing is shown below.

Glide.with(context)
           


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 14:30

    You can convert Base64 String to image using the following

    Glide.with(context)
        .load(Base64.decode(base64ImageString, Base64.DEFAULT))
        .asBitmap()
        .placeholder(R.drawable.ic_broken)
        .into(rowImageView);
    

提交回复
热议问题