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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

javascript - Chart.js - setting tooltip z-index -

how can i manage url using .htaccess in php? -