First of all you must have the two images, because you want to change from one to another, so you need the both images, and you must place it on the three drawable folders.
In my example I have to images, one called icon1.png and icon2.png.
After that, create a xml file inside the drawable folders (the same file for all drawable folders). This is the file:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When selected, use icon1 -->
<item android:drawable="@drawable/icon1"
android:state_selected="true" />
<!-- When not selected, use icon2-->
<item android:drawable="@drawable/icon2" />
</selector>
You can choose what image is the one which will appear when the tab is selected. In this case, the icon1 will appear, cause we declared it on the tag where state_selected=true.
So now, you have the two images and the xml file inside the three drawable folders. Ok!
Now, in the class you declare the tabs, add this line for each tab you want to add.
tabHost.addTab(tabHost
.newTabSpec("one")
.setIndicator("The Tab",
res.getDrawable(R.drawable.yourxmlfile))
.setContent(new Intent(this, YourClass.class)));
Remember that R.drawable.yourxmlfile correponds to the xml file you created in the drawable folders.
That's it! Hope this helps you.