I want to change the background image of tabs when they're selected and unselected. I've followed a few ways to do it from other questions but they didn't seem to work, could you check my code and see what I'm doing wrong? (The question I talked of - How to change the Tabs Images in the TabHost )
Below is the tab in MainActivity
TabSpec specs = th.newTabSpec("Tab1");
specs.setContent(R.id.tab1);
specs.setIndicator("Tab 1",
res.getDrawable(R.drawable.tab1_selector));
th.addTab(specs);
Below is the xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When selected, use icon1 -->
<item android:drawable="@drawable/selected"
android:state_selected="true" />
<!-- When not selected, use icon2-->
<item android:drawable="@drawable/unselected"
android:state_selected="false" />
</selector>
Thanks, Tom.