I have an ImageButton that is initially set to a drawable resource. During an Activity, I want to set the image to a bitmap of a user photo. The picture taking and saving work correctly, but the ImageButton's image does not change.
Here is my code:
Bitmap bitmap = BitmapFactory.decodeFile(PATH + "/image.jpg");
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 20, stream);
Log.d(TAG, bitmap.toString()); //prints out android.graphics.Bitmap@41d772a8
rearEndImageButton.setImageBitmap(bitmap);