Avoid bitmaps being recycled automatically in android
<p>In my application, I am storing some bitmap images in the HashMap.
with the hashmap as a member of a class ImageHolder.
I need the images in the HashMap in my program for further processing on the images.
When I run my application, the bitmap image is automatically recycled and I get 
<b> java.lang.IllegalStateException: </b> Can't call getPixels() on a recycled bitmap.</p>

<p>Please help me to avoid the bitmap image being recycled automatically.</p>

<p>Here is code for class ImageHolder : </p>

<pre><code>public class ImageHolder {

private HashMap&lt;String, Bitmap&gt; mImageMap = null;

public ImageHolder() {  

    mImageMap = new HashMap&lt;String, Bitmap&gt;();
}
/**
 * @return the mImageMap
 */
public Map&lt;String, Bitmap&gt; getmImageMap() {
    return mImageMap;
}
/**
 * @param mImageMap the mImageMap to set
 */
public void setmImageMap(HashMap&lt;String, Bitmap&gt; mImageMap) {
    this.mImageMap = mImageMap;
}

}
</code></pre>
