BufferedInputStream is necessary before decodestream....
Try this it works perfect for me use;
BufferedInputStream buf = new BufferedInputStream(inputsteam, 1024);
Pass buf to decode stream it will work perfectly.
Bitmap theImage = BitmapFactory.decodeStream(buf);
Finally set your bitmap.