2012-03-08 18 views
43

मेरे पास एक रैखिक लेआउट के अंदर एक टेक्स्ट व्यू है। अब मैं जावा में इस पाठ दृश्य को हटाना चाहता हूं। यह पाठ दृश्य गतिशील रूप से उत्पन्न होता है। मेरे पास रैखिक लेआउट आईडी है। इस रैखिक लेआउट के अंदर सभी सामग्री कैसे खाली करें?एंड्रॉइड खाली रैखिक लेआउट सामग्री

<LinearLayout android:layout_width="match_parent" 
     android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/myid"> 

<TextView .../> 

<TextView .../> 

<TextView .../> 
</LinearLayout> 

उत्तर

116

आप इस का उपयोग कर सकते हैं:

LinearLayout ll = (LinearLayout) findViewById(R.id.myid); 
ll.removeAllViews(); 
+1

+1 हाँ, आप सही हैं। – Luksprog

संबंधित मुद्दे