In my seTabColor() I'm setting the color of the title text to Gray. I want to change it to white when pressed. How can I do it?
public void setTabColor(TabHost tabHost) {
for(int i = 0; i<tabHost.getTabWidget().getChildCount(); i++) {
// tabHost.getTabWidget().getChildAt(i).setBackgroundResource(r[i]);
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.BLACK);
TextView t = (TextView) getTabWidget().getChildAt(i).findViewById(android.R.id.title);
t.setTextSize(9 * getResources().getDisplayMetrics().density);
// tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 58;
// tabHost.getTabWidget().getChildAt(i).().height = 58;
TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title);
tv.setTextColor(Color.GRAY);
}
I wanna do something like: tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab())...
But im not sure how to use that to conditionally change the text color.