Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add & delete view from Layout

Tags:

android

How can I add & delete a view from a layout?

like image 830
chiranjib Avatar asked Sep 27 '10 16:09

chiranjib


People also ask

Is ADD different from ADHD?

ADHD is the official, medical term for the condition — regardless of whether a patient demonstrates symptoms of hyperactivity. ADD is a now-outdated term that is typically used to describe inattentive-type ADHD, which has symptoms including disorganization, lack of focus, and forgetfulness.

What is ADD in a person?

What Is ADD (Attention Deficit Disorder)? ADD (attention deficit disorder) is the term commonly used to describe a neurological condition with symptoms of inattention, distractibility, and poor working memory.


2 Answers

I've done it like so:

((ViewManager)entry.getParent()).removeView(entry); 
like image 74
Nathan Schwermann Avatar answered Oct 05 '22 00:10

Nathan Schwermann


Use ViewStub and specify the layout of the view you want to toggle. To view:

mViewStub.setVisibility(View.VISIBLE) or mViewStub.inflate(); 

To disappear:

mViewStub.setVisibility(View.GONE); 
like image 27
Sameer Segal Avatar answered Oct 05 '22 02:10

Sameer Segal