Base64 decode for image/jpeg;base64 in android

前端 未结 2 1575
梦毁少年i
梦毁少年i 2020-12-31 22:16

I am trying to decode base64 encoded string into bitmap in android. The encoded string will start with \"image/jpeg;base64,\"

I use the following m

2条回答
  •  半阙折子戏
    2020-12-31 23:18

    You don't need the data:image/jpeg;base64, at the start of the string, that is actually not part of Base64 encoding per se but a Base64 Data URI for a web browser. Just pass the string from /9j/4AAQSkZJRgABAQAAAQABA... onwards and it will decode properly.

提交回复
热议问题