I'm not sure about the code, but I tried doing this:
ImageButton stuff = (ImageButton) createView.findViewById(R.id.stuff);
int stuff2 = stuff.getId();
champs.setImageResource(stuff2);
But that didn't work, the Imagebutton was shrinked for some reason, there was no image, just a gray rectangle.
try this
Bitmap bitmap = ((BitmapDrawable)stuff.getDrawable()).getBitmap();
stuff.getId();
This will return the id
of the View not the image resource associated with it. So you won't be having a resource related to this that is why you are not seeing the Image
.
Set a valid drawable to setImageResource
Some thing like R.drawable.drawable_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With