Вопрос

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top