Sanjay
Sanjay

Reputation: 43

How to deallocate android resources

How can I deallocate the memory of android resources like TextView, ImageView etc inside the onDestroy() method because they are consuming memory and tell me how to release memory.

Upvotes: 4

Views: 510

Answers (1)

Nargis
Nargis

Reputation: 4787

Garbage Collector will release resources for you.

Just make sure you are not holding references that are no more required.

You can try setting your references to null in onDestroy() call back method.

Also, you can use Memory Analyzer Tool to investigate further.

Upvotes: 1

Related Questions