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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -