H have multiple TextViews
inside an LinearLayout
. Now I want to delete this text view in java. The views are generated dynamically. How can I empty all contents inside this LinearLayout
?
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/myid">
<TextView .../>
<TextView .../>
<TextView .../>
</LinearLayout>
You can use this:
LinearLayout ll = (LinearLayout) findViewById(R.id.myid);
ll.removeAllViews();