package com.joshclemm.android.tabs;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;

public class CustomTabActivity extends Activity {

	private TabHost mTabHost;

	private void setupTabHost() {
		mTabHost = (TabHost) findViewById(R.id.mytabhost);
		mTabHost.setup();
	}

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// construct the tabhost
		setContentView(R.layout.main);

		setupTabHost();
		mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

		setupTab(new TextView(this), "Tab 1");
		setupTab(new TextView(this), "Tab 2");
		setupTab(new TextView(this), "Tab 3");
	}

	private void setupTab(final View view, final String tag) {
		View tabview = createTabView(mTabHost.getContext(), tag);

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

	}

	private static View createTabView(final Context context, final String text) {
		View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);
		TextView tv = (TextView) view.findViewById(R.id.tabsText);
		tv.setText(text);
		return view;
	}
}
@@ -49,291 +49,80 @@
 oid.
-app.Activity;%0Aimport android.content.Context;%0Aimport android.os.Bundle;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.widget.TabHost;%0Aimport android.widget.TextView;%0Aimport android.widget.TabHost.TabContentFactory;%0Aimport android.widget.TabHost.TabSpec
+view.View;%0Aimport android.widget.TabHost;%0Aimport android.widget.TextView
 ;%0A%0Ap
@@ -159,16 +159,28 @@
 extends 
+android.app.
 Activity
@@ -323,59 +323,8 @@
 %09%7D%0A%0A
-%09/** Called when the activity is first created. */%0A
 %09@Ov
@@ -352,16 +352,27 @@
 nCreate(
+android.os.
 Bundle s
@@ -830,16 +830,39 @@
 ag);%0A%0A%09%09
+android.widget.TabHost.
 TabSpec 
@@ -936,16 +936,39 @@
 ent(new 
+android.widget.TabHost.
 TabConte
@@ -1123,16 +1123,32 @@
 w(final 
+android.content.
 Context 
@@ -1191,16 +1191,29 @@
  view = 
+android.view.
 LayoutIn

remove imports for single-use names