package com.joshclemm.android.tabs;

import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;

public class CustomTabActivity extends android.app.Activity {

	private TabHost mTabHost;

	@Override
	public void onCreate(android.os.Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		mTabHost = (TabHost) findViewById(R.id.mytabhost);
		mTabHost.setup();
		mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

		for (String TabName : new String[]{"Tab 1", "Tab 2", "Tab 3"})
		  {
			setupTab(new TextView(this), TabName);
		  } /*for*/
	}

	private void setupTab(final View view, final String tag) {
		View tabview = android.view.LayoutInflater.from(this).inflate(R.layout.tabs_bg, null);
		((TextView)tabview.findViewById(R.id.tabsText)).setText(tag);

		android.widget.TabHost.TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(new android.widget.TabHost.TabContentFactory() {
			public View createTabContent(String tag) {return view;}
		});
		mTabHost.addTab(setContent);

	}
}

@@ -665,16 +665,23 @@
 al View 
+content
 view, fi
@@ -705,19 +705,25 @@
 %0A%09%09View 
-tab
+indicator
 view = a
@@ -806,19 +806,25 @@
 extView)
-tab
+indicator
 view.fin
@@ -863,17 +863,16 @@
 t(tag);%0A
-%0A
 %09%09androi
@@ -908,17 +908,20 @@
 ontent =
- 
+%0A%09%09%09
 mTabHost
@@ -936,16 +936,21 @@
 pec(tag)
+%0A%09%09%09%09
 .setIndi
@@ -959,28 +959,52 @@
 tor(
-tabview).setContent(
+indicatorview)%0A%09%09%09%09.setContent%0A%09%09%09%09  (%0A%09%09%09%09%09
 new 
@@ -1045,19 +1045,29 @@
 actory()
- %7B%0A
+%0A%09%09%09%09%09  %7B%0A%09%09%09
 %09%09%09publi
@@ -1105,27 +1105,114 @@
 tag)
- %7Breturn view;%7D%0A%09%09%7D
+%0A%09%09%09%09%09%09  %7B%0A%09%09%09%09%09%09%09return contentview;%0A%09%09%09%09%09%09  %7D /*createTabContent*/%0A%09%09%09%09%09  %7D /*TabContentFactory*/%0A%09%09%09%09  
 );%0A%09
@@ -1241,14 +1241,13 @@
 ntent);%0A
-%0A
 %09%7D%0A%7D%0A

bring more clarity to tab setup