android - Check if view element is added to layout or not programmatically -


in fragment class, add child view element programmatically layout conditionally :

linearlayout child = (linearlayout) inflater.inflate(r.layout.child_view, null);  layoutparams params = new layoutparams(layoutparams.wrap_content,100);  container.addview(child, params); 

since above code run conditionally, so, @ point, i check if child view has added or not, how make checking programmatically?

i think can use

findviewbyid(your_view_id)  

method: if result null view not exists, otherwise view present


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -