android: add empty tab first and set content later -
in example below, there way add empty tab first , set content later when args value not null?
public class mainactivity extends fragmentactivity { private fragmenttabhost mtabhost; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); .........//more code bundle args = new bundle(); args.putserializable("arguments", object); .................. mtabhost.addtab(mtabhost.newtabspec("tab1").setindicator("tab1"), tab1fragment.class, args); mtabhost.addtab(mtabhost.newtabspec("tab2").setindicator("tab2"), tab2fragment.class, args); mtabhost.addtab(mtabhost.newtabspec("tab3").setindicator("tab3"), tab3fragment.class, args); } }
as per android api documentation of fragmenttabhost, add tab when argue not null , use setup method
Comments
Post a Comment