Android TAB: not able to see the tab bar for a particular activity
<p>My Android <code>TabActivity</code> class looks like this - </p>

<pre><code>public class CustomTabActivity extends ActivityGroup {

    private TabHost mTabHost;
    private Intent intent;

    private void setupTabHost() {
        mTabHost = (TabHost) findViewById(android.R.id.tabhost);
        mTabHost.setup(this.getLocalActivityManager());
        mTabHost.setCurrentTab(0);
    }

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

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

        setupTab(new TextView(this), "Messages",TestAct2.class);
        setupTab(new TextView(this), "Bookings",CalendarViewActivity.class);
        setupTab(new TextView(this), "Menu",TestAct2.class);
    }

    private void setupTab(final View view, final String tag,final Class activity) {
        View tabview = createTabView(mTabHost.getContext(), tag);
        intent = new Intent().setClass(this, activity);

        TabSpec setContent = mTabHost.newTabSpec("ActivityGroup1").setIndicator(tabview).setContent(intent);
        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;
    }
}
</code></pre>

<p>CalendarViewActivity.java is like this - </p>

<pre><code>public class CalendarViewActivity extends ActivityGroup implements OnClickListener
{
    private static final String tag = "SimpleCalendarViewActivity";

    //private ImageView calendarToJournalButton;
    private Button selectedDayMonthYearButton;
    private Button currentMonth;
    private ImageView prevMonth;
    private ImageView nextMonth;
    private GridView calendarView;
    private GridCellAdapter adapter;
    private Calendar _calendar;
    private int month, year;
    private final DateFormat dateFormatter = new DateFormat();
    private static final String dateTemplate = "MMMM yyyy";

    private Context context;
    private Date currentDate;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);



            context = this;
            setContentView(R.layout.simple_calendar_view);

            _calendar = Calendar.getInstance(Locale.getDefault());
            month = _calendar.get(Calendar.MONTH) + 1;
            year = _calendar.get(Calendar.YEAR);
            Log.d(tag, "Calendar Instance:= " + "Month: " + month + " " + "Year: " + year);

            selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);
            selectedDayMonthYearButton.setText("Selected: ");

            prevMonth = (ImageView) this.findViewById(R.id.prevMonth);
            prevMonth.setOnClickListener(this);

            currentMonth = (Button) this.findViewById(R.id.currentMonth);
            currentMonth.setText(dateFormatter.format(dateTemplate, _calendar.getTime()));

            nextMonth = (ImageView) this.findViewById(R.id.nextMonth);
            nextMonth.setOnClickListener(this);

            calendarView = (GridView) this.findViewById(R.id.calendar);

            // Initialised
            adapter = new GridCellAdapter(getApplicationContext(), R.id.calendar_day_gridcell, month, year);
            adapter.notifyDataSetChanged();
            calendarView.setAdapter(adapter);
        }
</code></pre>

<p>activity_customtab.xml is - </p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"&gt;

&lt;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" &gt;
    &lt;RelativeLayout android:orientation="vertical"
        android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="0.5dip"
            android:background="#000" /&gt;
        &lt;TabWidget android:id="@android:id/tabs"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_marginLeft="0dip" android:layout_marginRight="0dip"  android:gravity="bottom"
        android:layout_alignParentBottom="true"/&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="2dip"
            android:background="#696969" /&gt;
        &lt;View android:layout_width="fill_parent" android:layout_height="2dip"
            android:background="#000" /&gt;
        &lt;FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt;
    &lt;/RelativeLayout&gt;
&lt;/TabHost&gt;
</code></pre>

<p></p>

<p>My Problem is that When I click on tab 2 which is "Bookings", it covers the whole screen and the tab is no where to be seen.</p>

<p>Could you guys please tell me what am I doing wrong. My other two tabs are working fine though.</p>
