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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:36:32+00:00 2026-06-13T14:36:32+00:00

Just to clarify. I have a TabHost, and inside that tabhost are like 5

  • 0

Just to clarify. I have a TabHost, and inside that tabhost are like 5 tabs. I’m playing around with tabhost so I’m trying to close one of the tabs (i.e. one of the child views). The problem is that even though it works, the layout below the tabs stays the same, i.e. if I had a textview in the tab I’m closing, and a button in the main tab, when I close the tab with the textview, the tab does disappear but the textview remains. This is the code I’m using to close a tab:

    int vPos = mHost.getCurrentTab();
    TabWidget tWidget = mHost.getTabWidget();

    if (vPos != 0) {
        tWidget.setCurrentTab(0);
        tWidget.removeView(mHost.getTabWidget().getChildAt(vPos));

    }

So basically it closes the tab, switches to the other tab, but the layout BELOW the tabs remains the exact same. I know people would like me to post the full code including layout and whatnot, but this is a general thing, it doesn’t regard the layout, it only regards the tabs (if I’m mistaken feel free to point it out).

Maybe I’m supposed to call invalidate() on the views but that doesn’t work whether I invalidate the child view, the tab widget or the tabhost.

  • 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-06-13T14:36:33+00:00Added an answer on June 13, 2026 at 2:36 pm

    Unfortunately this is an issue internally in TabWidget due to lack of a removeTab function.
    When you call removeView from the TabWidget, the removeView is called from the ViewGroup class which has no notion of tabs.
    As a result, you are actually only removing the actual tab and leaving the indexes and layouts below unaffected.

    A excessive workaround would be to call removeAllViews and re-add all the views.

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

Sidebar

Related Questions

Just to clarify, by specifying something like VARCHAR(45) means it can take up to
Just a knowledge question which I would like to ask: For example, I have
Just playing around with Wordpress / Contact Form 7 . Is it possible to
Can anyone just clarify this for me, I was under the impression that to
I need just to clarify that given collection contains an element. I can do
Just to clarify that I also think the title is a bit silly. We
If I have significant amounts of text and am trying to discover templates that
I have a secured website that requires a user to authenticate, and would like
Just to clarify while learning this stuff: If I have a scene with just
The title pretty much says it all, but just to clarify: I have an

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.