Search code examples
android-tabhost

Android Tabwidget change Textview color programatically


In below tabview layout contents how to get reference for each textview and change color, text programatically.?

For example i want to change RF1235678 textview color and text

enter image description here


Solution

  • @Vishwanath

    TabSpec tab1 = tabHost.newTabSpec("First Tab");
    
    TextView textView = new TextView(this);
    textView.setText("exampletab");
    textView.setTextColor(Color.BLUE);
    tab1.setIndicator(textView);
    
    tabHost.addTab(tab1);