Which command to clear memory on Android

1

I am using ImageView which are calls by buttons to load the images fills the memory consisting of this error java.lang.OutOfMemoryError would have a command that would clear the memory.

    
asked by anonymous 02.02.2015 / 15:40

1 answer

3

When you upload the images, use the code below:

((BitmapDrawable) yourImageView.getDrawable()).getBitmap().recycle();
    
02.02.2015 / 15:47