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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assign id to your layout, get a reference to it and call
removeAllViews();to remove all its child view. If l1 is my LinearLayout, thenl1. removeAllViews();