android - Getting the textview of the TabLayout's tab -
i want programmatically change tab's textview programmatically. there way this?
there answers concerning old tabhost view, using tablayout used google's material design library using android.support.design.widget.tablayout.
for tabhost: how add padding tabs label?
this working solution
int wantedtabindex = 0; textview tv = (textview)(((linearlayout)((linearlayout)mtablayout.getchildat(0)).getchildat(wantedtabindex)).getchildat(1)); tv.settext("hello world!");
just change last index zero one above code work
removed crash
java.lang.classcastexception: android.widget.imageview cannot cast android.widget.textview
Comments
Post a Comment