I have a very simple application with one ImageView and a Button. The first Drawable resource loaded by my ImageView is specified with the \"android:src\" tag i
The problem has now been solved. rather than only one line:
((BitmapDrawable)imageView.getDrawable()).getBitmap().recycle();
add this code before updating ImageView content:
Drawable toRecycle= gallerypic.getDrawable();
if (toRecycle != null) {
((BitmapDrawable)gallerypic.getDrawable()).getBitmap().recycle();
}
gallerypic.setImageURI(selectedimage);