How exactly does image recycling work in Android?
Allow me to elaborate:
If I have the following:
myBitmap = BitmapFactory.decodeResource(curView.getResources(), R.drawable.mypic);
And log the following
Log.v("ImageStuff","Image is: "+myBitmap);
I get the following result:
Image is: android.graphics.Bitmap@(ResourceID here)
Which is great, however if I do the same thing but call a recycle like so
myBitmap = BitmapFactory.decodeResource(curView.getResources(), R.drawable.mypic);
myBitmap.recycle()
I get the same results as above. I thought that calling recycle would clear the bitmap so it would log as null?
Also if I have a method that takes a bitmap like so:
public void doStuff(Bitmap pic){
//Code here
}
Create my bitmap as above and send it through to doStuff:
myBitmap = BitmapFactory.decodeResource(curView.getResources(), R.drawable.mypic);
doStuff(myBitmap);
If I want to recycle the image, would I need to call myBitmap.recycle(); as well as pic.recycle (within my doStuff method after I'd finishing with it).?