Question

Hello I am trying to get bitmap from URL in the Fragment. I know programmer should recycle the bitmap to release the memory and avoid OutOfMemoryException.

So here I am very confused where I should call recycle method in Fragment and Activity, I see many answer but that didn't seems to me any nice answer like android fragment: recycle bitmap

Can you please help me to clear my confusion.

Thanks in advance

Était-ce utile?

La solution

call the recycle method in onDestroy() if you finish using it when the activity / fragment is destroyed. Otherwise recycle it as soon as you are finished using it

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top