Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we reset or empty layout in android

Tags:

android

Hi I am working on an application which creates dynamic components like buttons etc. When a certain condition occurs, I want to remove or empty my layout.. Can anyone guide or suggest me?

like image 369
Sumit Avatar asked Jun 29 '12 14:06

Sumit


2 Answers

Use the function removeAllViews() on your layout.

like image 84
Swayam Avatar answered Oct 19 '22 19:10

Swayam


All of the Layout classes are children of ViewGroup so you can use the ViewGroup.removeAllViews() method

like image 43
FoamyGuy Avatar answered Oct 19 '22 18:10

FoamyGuy