1

I am working on Android Tabs with sdk minimum version API 11 and target is API 17. I have written code like this.

public class MainScreenActivity extends TabActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_screen);  

        TabHost tabHost = getTabHost();

        Intent homeIntent = new Intent(this, HomeScreenView.class);


        tabHost.addTab(tabHost.newTabSpec("Home")
                .setIndicator("Home", getResources().getDrawable(R.drawable.home_states))
                .setContent(homeIntent));


    }
} 

and I am using standard Tab xml file like this.

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <RelativeLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:layout_alignParentBottom="true" />
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"/>
    </RelativeLayout>
</TabHost>

I am not getting icon for tab and also tab text is showing in capital letter. If I set the sdkminVersion 8 and remove the target then its works fine. please help me out.

Android learner
  • 1,871
  • 4
  • 24
  • 36

0 Answers0