0

I have a problem with my TabHost, I can not change the color. Here is my code:

intent = new Intent().setClass(this, DosageActivity.class);
spec = tabHost
        .newTabSpec("")
        .setIndicator("Dosages",
             res.getDrawable(android.R.drawable.ic_menu_manage))
        .setContent(intent);
tabHost.addTab(spec);

I tried several solutions written on the site but I can not do it and I'd keep the same code. Thank you in advance

Heiko Rupp
  • 30,426
  • 13
  • 82
  • 119
  • try http://stackoverflow.com/questions/9356546/is-it-possible-to-change-the-color-of-selected-tab-in-android?rq=1 – petey Dec 02 '15 at 22:07

1 Answers1

0

Override onTabChanged() and then get mTabHost.getCurrentTabView() and just set the BackgroundResource for the view as view.setBackgroundResource(). For more you can check this answer.

Community
  • 1
  • 1
Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242