DecodeByteArray with WebService image always null
-
26-09-2019 - |
Question
There what I am trying to do :
I am calling a WebService that send me back an image.
I get it from the entity.getContent()
method.
Further in my code I try to use de BitmapFactory.decodeByteArray(myImage, 0, myImage.lenght)
but the Bitmap that it returns me is always null
Does someone have an idea ?
Solution
decodeByteArray returns null when the image cannot be decoded from that array, you are probably getting the image in a format that BitmapFactory doesnt understand.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow