i inflate xml in tablelayout within linearlayout within scrollview.
this main.xml:
<scrollview..> <linearlayout> <tablelayout> </tablelayout> </linearlayout> </scrollview> this xml inflate tabletoinflate.xml
<tablelayout> </tablelayout> tl1 = (tablelayout)getview().findviewbyid(r.id.tablelayout1); //this exists in oncreate //this method supposed inflate, it's not doing job
void mymethodtoinflate() { layoutinflater inflater =(layoutinflater)getactivity().getsystemservice(context.layout_inflater_service); view view = inflater.inflate(r.layout.tabletoinflate, null; initializetogglespost(view); tl1.removeallviews(); tl1.addview(view); } //this method initializes 24 toggle buttons inside tablelayout inflate.
private void initializetogglespost(view viewpost) { togglebuttonspost = new togglebutton[24]; for(int = 0;i<24;i++) { togglebuttonspost[i] = (togglebutton)viewpost.findviewwithtag((string) ((i+1) + "")); togglebuttonspost[i].setonclicklistener(this); } }
Comments
Post a Comment