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

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

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

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