Reputation: 37701
I have some huge layouts which I need to free from the memory in some cases, and these layouts have a lot of children.
Which is the best way to achieve it?
I can't find the way on Google.
Upvotes: 0
Views: 870
Reputation: 14058
Assign id to your layout, get a reference to it and call removeAllViews();
to remove all its child view. If l1 is my LinearLayout, then l1. removeAllViews();
Upvotes: 2