You are using TabHost, first of which its deprecated and still u want to use it change the extends part of you class with TabActivity
EDIT:
My Code with TabActivity Change it as per your requirement:
public class MainActivity extends TabActivity {
/** The m tab host. */
private TabHost mTabHost;
/** The intent. */
Intent intent;
/** The feature. */
short feature = 1;
/** The deal. */
short deal = 2;
/** The bundle. */
Bundle bundle;
/** The my drawable. */
Drawable myDrawable;
/** The active fragment. */
public TabFragment activeFragment;
/** The add deal interface. */
AddDealInterface addDealInterface;
/** The link name. */
String linkName;
/**
* Sets the adds the deal interface.
*
* @param addDealInterface
* the new adds the deal interface
*/
public void setAddDealInterface(AddDealInterface addDealInterface) {
this.addDealInterface = addDealInterface;
}
/*
* (non-Javadoc)
*
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.tab);
String Language = getIntent().getStringExtra("lang");
mTabHost = (TabHost) findViewById(android.R.id.tabhost);
mTabHost.setup();
myDrawable = getResources().getDrawable(R.drawable.tabclick1);
bundle = new Bundle();
bundle.putShort("Value", feature);
bundle.putString("lang", Language);
final Intent i = new Intent().setClass(this, MainView.class);
i.putExtra("bundle", bundle);
TabSpec spec1 = mTabHost.newTabSpec(getString(R.string.featured));
spec1.setContent(i);
spec1.setIndicator(createTabView(getApplicationContext(), myDrawable,
getString(R.string.featured)));
myDrawable = getResources().getDrawable(R.drawable.tabclick2);
bundle = new Bundle();
bundle.putShort("Value", deal);
bundle.putString("lang", Language);
final Intent i2 = new Intent().setClass(this, MainView.class);
i2.putExtra("bundle", bundle);
TabSpec spec2 = mTabHost.newTabSpec(getString(R.string.deals));
spec2.setContent(i2);
spec2.setIndicator(createTabView(getApplicationContext(), myDrawable,
getString(R.string.deals)));
myDrawable = getResources().getDrawable(R.drawable.tabclick3);
bundle = new Bundle();
bundle.putString("lang", Language);
final Intent i3 = new Intent().setClass(this, FavoriteView.class);
i3.putExtra("bundle", bundle);
TabSpec spec3 = mTabHost.newTabSpec(getString(R.string.favorite));
spec3.setContent(i3);
spec3.setIndicator(createTabView(getApplicationContext(), myDrawable,
getString(R.string.favorite)));
myDrawable = getResources().getDrawable(R.drawable.tabclick4);
bundle = new Bundle();
bundle.putString("lang", Language);
final Intent i4 = new Intent().setClass(this, Search.class);
i4.putExtra("bundle", bundle);
TabSpec spec4 = mTabHost.newTabSpec(getString(R.string.search));
spec4.setContent(i4);
spec4.setIndicator(createTabView(getApplicationContext(), myDrawable,
getString(R.string.search)));
myDrawable = getResources().getDrawable(R.drawable.tabclick5);
bundle = new Bundle();
bundle.putString("lang", Language);
final Intent i5 = new Intent().setClass(this, SettingView.class);
i5.putExtra("bundle", bundle);
TabSpec spec5 = mTabHost.newTabSpec(getString(R.string.setting));
spec5.setContent(i5);
spec5.setIndicator(createTabView(getApplicationContext(), myDrawable,
getString(R.string.setting)));
mTabHost.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
int selectedTab = mTabHost.getCurrentTab();
if (selectedTab == 0) {
myDrawable = getResources().getDrawable(R.drawable.close);
linkName = getString(R.string.featured);
}
if (selectedTab == 1) {
myDrawable = getResources().getDrawable(
R.drawable.ic_action_search);
linkName = getString(R.string.deals);
}
if (selectedTab == 2) {
myDrawable = getResources().getDrawable(R.drawable.setting);
linkName = getString(R.string.favorite);
}
if (selectedTab == 3) {
myDrawable = getResources().getDrawable(R.drawable.setting);
linkName = getString(R.string.search);
}
if (selectedTab == 4) {
myDrawable = getResources().getDrawable(R.drawable.setting);
linkName = getString(R.string.setting);
}
Log.d("SELECTED", "" + selectedTab);
}
});
mTabHost.addTab(spec1);
mTabHost.addTab(spec2);
mTabHost.addTab(spec3);
mTabHost.addTab(spec4);
mTabHost.addTab(spec5);
}
/*
* (non-Javadoc)
*
* @see android.support.v4.app.FragmentActivity#onActivityResult(int, int,
* android.content.Intent)
*/
@Override
protected void onActivityResult(int arg0, int arg1, Intent arg2) {
super.onActivityResult(arg0, arg1, arg2);
// AddDeal deal = new AddDeal();
if (addDealInterface != null)
addDealInterface.onRespondedResult(arg0, arg1, arg2);
// Toast.makeText(this, "I am called", Toast.LENGTH_SHORT).show();
}
/**
* Creates the tab view.
*
* @param context
* the context
* @param drawable
* the drawable
* @param text
* the text
* @return the view
*/
public static View createTabView(Context context, Drawable drawable,
String text) {
View view = LayoutInflater.from(context).inflate(R.layout.tabs_main_bg,
null);
TextView textView = (TextView) view.findViewById(R.id.lblTabTag);
ImageView imageView = (ImageView) view.findViewById(R.id.imgTabTag);
imageView.setImageDrawable(drawable);
textView.setText(text);
textView.setTextColor(Color.WHITE);
return view;
}
/*
* (non-Javadoc)
*
* @see android.support.v4.app.FragmentActivity#onDestroy()
*/
@Override
protected void onDestroy() {
super.onDestroy();
mTabHost = null;
}
/*
* (non-Javadoc)
*
* @see android.support.v4.app.FragmentActivity#onBackPressed()
*/
@Override
public void onBackPressed() {
activeFragment.onBackPressed();
}
// method for TabFragment to call when the user navigates out of the app
/**
* Close.
*/
public void close() {
super.onBackPressed();
}
}