How can we reset or empty layout in android

Hi, I am working on an application that creates dynamic components like buttons, etc. When a certain condition occurs, I want to delete or delete my layout. Can anyone advise or suggest me?
+5
source share
3 answers

Use the removeAllViews () function on your layout.

+5
source

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

+3
source

yourLayout.removeAllViews(); ....

0

All Articles