Try this:
ImageButton btn = (ImageButton)findViewById(R.id.button1);
btn.setImageResource(R.drawable.newimage);
where newimage
is the image name in drawable folder.
EDITED
try this:
ImageButton btn = (ImageButton)findViewById(R.id.button1);
btn.setImageBitmap(bm);
where bm is bitmap extracted from server.
EDITED AGAIN
I see you receive a Drawable; well, do this:
normalImage = Drawable.createFromStream(code);
Bitmap bm = ((BitmapDrawable)normalImage).getBitmap();
ImageButton btn = (ImageButton)findViewById(R.id.button1);
btn.setImageBitmap(bm);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…