views:

161

answers:

1

I ask if there is a simple way because there is a google issue report saying that using decodeByteArray isn't possible. But that report originated in 2008 and I was hoping there was a solution not posted on there. The method listed on the issue report was to decode the format yourself, but I'd prefer to not have to put that in and slow down the program. Any help at all would be appreciated.

+1  A: 

The easiest way is to create a BufferedImage the following way:

Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0. data.length);

data is the byte array.

Roflcoptr
Um are you sure that works in Android? I can't find any reference material for BufferedImage or ImageIO. Its listed in the Java language reference but not Android's
RyoxSinfar
Yes i copied the wrong code. I modified my answer. Sorry.
Roflcoptr
THats what I originally thought the answer was, but it gives me a null bitmap back.
RyoxSinfar