BitmapFactory.decodeByteArray(decode, 0, decode.length) return null

compileSdkVersion 29

java 1.8.0_13

kotlin plugin ver 1.4.0-release-studio4.0-1

my function

public static Bitmap base64ToBitmap(String imgString) {         byte[] decode = Base64.decode(Uri.decode(imgString), Base64.DEFAULT |Base64.NO_WRAP);         return BitmapFactory.decodeByteArray(decode, 0, decode.length);     } 

the byteArray decode isn`t null , but BitmapFactory.decodeByteArray is null when I run this code. Even more strange is that when I use debug evaluate expression ,it runs fine like the picture below. This makes me feel very confused enter image description here

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.