Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6095177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:47:00+00:00 2026-05-23T12:47:00+00:00

I have created a tab based app, in one of the tab, there is

  • 0

I have created a tab based app, in one of the tab, there is also inner tab where some data is displayed in tabular format using adapter. It is perfectly ok in all devices with Android 2.1. But in all the devices with Android 2.2 devices, it is just showing only first tab only with black screen above. I have given two different screenshot for the reference.

Screenshot of 2.1 device

Screenshot of 2.1 device

Screenshot of 2.2 device

Screenshot of 2.2 device

XML for tabactivity

<?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">
    <LinearLayout
        android:id="@+id/myinfotrackerlayout"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"/>
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
            android:gravity="bottom" 
            android:isScrollContainer="false" 
            android:scrollbarAlwaysDrawHorizontalTrack="false" 
            android:scrollbarAlwaysDrawVerticalTrack="false" 
            android:scrollbars="none"
            android:background="#FFFFFF"/>
    </LinearLayout>
</TabHost>

Code for Tabactivity

public class MyInfoTracker extends TabActivity {
    private int tabid = 0;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myinfotracker);
        try{
            final TabHost innerTabHost = getTabHost();  // The activity TabHost
            TabHost.TabSpec spec;  // Resusable TabSpec for each tab

            Intent intent;  // Reusable Intent for each tab
            Intent myint = this.getIntent();
            tabid = myint.getIntExtra("tab_id", 0);

            // Create an Intent to launch an Activity for the tab (to be reused) 
            intent = new Intent().setClass(this, MyinfoActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP );
            intent.putExtra("addType","CD4");

            // Initialize a TabSpec for each tab and add it to the TabHost
            spec = innerTabHost.newTabSpec("CD4Count").setIndicator("CD4 Count").setContent(intent);
            innerTabHost.addTab(spec);

            // Do the same for the other tabs
            intent = new Intent().setClass(this, MyinfoActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP );
            intent.putExtra("addType","VL");
            spec = innerTabHost.newTabSpec("ViralLoad").setIndicator("Viral Load").setContent(intent);
            innerTabHost.addTab(spec);

            // Do the same for the other tabs
            intent = new Intent().setClass(this, MyinfoActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP );
            intent.putExtra("addType","Wt");
            spec = innerTabHost.newTabSpec("Weight").setIndicator("Weight").setContent(intent);
            innerTabHost.addTab(spec);

            innerTabHost.setScrollbarFadingEnabled(false);
            innerTabHost.setScrollContainer(false);

            innerTabHost.setCurrentTab(tabid);
        }catch(Exception e){}
    }
}

What may cause this type of problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:47:00+00:00Added an answer on May 23, 2026 at 12:47 pm

    It is not at all tab related prob. In onCreate() there is a code-

    datePickerDialog = new DatePickerDialog(getParent(), ButtonTestDateListener,
                    mYear, mMonth, mDay);
    

    I have just declare the mYear, mMonth and mDay as Integer, but no initialization was there. It is working fine in 2.1, but giving prob in 2.2. Thats why it is giving such problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab bar based app. But from one screen the user may
I have created a tab based app drawing both nib-designed views and pragmatically designed
I have created tab style interface using css and javascript with only two tabs
I have created a horizontal menu with 5 tab options using a ul and
I have created an windows service. I want to open some windows based application
I have a tab bar + navigation based app and I'd like to launch
I am having an issue: I have a tab-bar based app. In MainWindow.xib for
I have Xcode 4 and I created an application using the Tab Bar template
I have a tabbar based app and would like to reference one of three
I have following problem. I have created a tab based Application with three Views

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.