I am trying to implement the following background for the application...
For t
For this you must use Custom Tabs ,here is the Code try this :
tabHost= getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1").setContent(new Intent(this, Activity2.class)).setIndicator(prepareTabView("Names",R.drawable.icon)));
where prepareTabView is method that Inflate View. Then Inflate a view like this :
private View prepareTabView(String text, int resId) {
View view = LayoutInflater.from(this).inflate(R.layout.tabs, null);
ImageView iv = (ImageView) view.findViewById(R.id.TabImageView);
TextView tv = (TextView) view.findViewById(R.id.TabTextView);
iv.setImageResource(resId);
tv.setText(text);
return view;
}
Where tabs XML will look like this :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:id="@+id/TabLayout"
android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:padding="5dip">
<ImageView android:id="@+id/TabImageView" android:src="@drawable/icon"
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<TextView android:id="@+id/TabTextView" android:text="Text"
android:paddingTop="5dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="@color/black"
android:textAppearance="@style/TabTextViewStyle" />
</LinearLayout>
Then now add your backgroung color as you like..
TabActivity is Deprecated from Android 4.2,API level 17. Use Fragments instead of TabActivity