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 7170875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:17:59+00:00 2026-05-28T15:17:59+00:00

I’m using a custom TabWidget to display my tabs. The tabs work wonderfully when

  • 0

I’m using a custom TabWidget to display my tabs. The tabs work wonderfully when I first run the program. Everything looks beautiful. However, when I reload the program and, according the logcat, the onResume() method is called on my Tab Widget, the TabWidget displays only the top half of the widget. Here is the XML for my TabWidget.

<?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: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_above="@android:id/tabs"/>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="55dp"
            android:layout_alignParentBottom="true" />

    </RelativeLayout>

</TabHost>

It’s pretty plain vanilla stuff here. Changing the layout_height doesn’t help.

I am currently not implementing onResume in my TabWidget.java. But heres the code anyway.

public class TabWidget extends TabActivity {

    private TabHost mTabHost;

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

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.tabs);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); // The
                                                                        // activity
                                                                        // TabHost

        TabHost.TabSpec spec; // Resusable TabSpec for each tab
        Intent intent; // Reusable Intent for each tab

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

        // Dealer tab
        Intent intentDealer = new Intent().setClass(this, DealerActivity.class);
        int iconDealer = (R.drawable.ic_tab_dealer);
        setupTab("Dealer", intentDealer, iconDealer);

        // Department tab
        Intent intentDept = new Intent().setClass(this, DeptActivity.class);
        int iconDept = R.drawable.ic_tab_dept;
        setupTab("Departments", intentDept, iconDept);

        // PostBoard Activity
        Intent intentBoard = new Intent().setClass(this, BoardActivity.class);
        int iconBoard = R.drawable.ic_tab_board;
        setupTab("Postboard", intentBoard, iconBoard);

        // Social Network connection
        // Check first to see if there are Social Network links if not don't
        // show tab.
        if (Startup.msMain.locations[Startup.nChosenLocation].social_media_feeds.length == 0) {

        } else {
            Intent intentSocial = new Intent().setClass(this,
                    SocialActivity.class);
            int iconSocial = R.drawable.ic_tab_social;
            setupTab("Social Media", intentSocial, iconSocial);
        }

        // Links Activity
        Intent intentLinks = new Intent().setClass(this, LinksActivity.class);
        int iconLinks = R.drawable.ic_tab_link;
        setupTab("Links", intentLinks, iconLinks);

        // set startup tab
        tabHost.setCurrentTab(0);
    }

    private void setupTab(final String tag, Intent intent, int img) {
        View tabview = createTabView(mTabHost.getContext(), tag, img);

        TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview)
                .setContent(intent);

        mTabHost.addTab(setContent);

    }

    private static View createTabView(final Context context, final String text,
            int img) {
        View view = LayoutInflater.from(context)
                .inflate(R.layout.tabs_bg, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        ImageView icon = (ImageView) view.findViewById(R.id.tabsIcon);
        icon.setBackgroundDrawable(context.getResources().getDrawable(img));
        return view;
    }
}

And for thoroughness here’s my logcat when the error appears.

   12-28 10:10:00.963: I/ActivityManager(1305): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.zocalolabs.demo/.SplashScreen } from pid 1470
   12-28 10:10:01.034: W/InputManagerService(1305): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40777988 (uid=10001 pid=1470)
   12-28 10:10:01.073: I/ActivityManager(1305): Resumed Activity: com.zocalolabs.demo/.TabWidget totalTime: 110 ms

Is there a way to force my widget activity to redraw on onResume() or onPause() force it to full on kill the Activity thus forcing it to the onCreate method again? Or is there another way to attack this problem? Thanks for any insights!

  • 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-28T15:18:00+00:00Added an answer on May 28, 2026 at 3:18 pm

    The problem was that

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    was clipping the bottom of the activity view. I don’t know if this is a bug or what but the fix was to add the following line.

       getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
                WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    

    Hope this helps someone else.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

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.