java - LinearLayout nesting -


is possible create method inflate layout (or create dynamically), add specific views (in case textviews), retun layout view, (somehow) incorporate in main layout in other class, nesting, dynamic adding of elements?

yes possible:

... oncreate()   {   setcontentview(...);   viewgroup mycontainer=(viewgroup)findviewbyid(r.id.mycontainer);   view v=inflatemyspecialview();   //=<set layoutparams view if needed   mycontainer.addview(v);   }  public view inflatemyspecialview()   {   viewgroup viewgroup=(viewgroup ) getlayoutinflater().inflate(r.layout.my_custom_layout, null,false);   //do stuff inflated viewgroup.   return viewgroup;   } 

Comments

Popular posts from this blog

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

html - Cut text on left side inside button while centering -

php - Hide Categories from WordPress Dashboard by ID and Custom Post Type -