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

  • Home
  • SEARCH
  • 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 6802521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:14:00+00:00 2026-05-26T19:14:00+00:00

I have a TabHost holding 5 tabs. As far as I can see, there

  • 0

I have a TabHost holding 5 tabs.
As far as I can see, there has to be one tab selected at all times.

I need a way to unselect all my tabs so none will be selected.

If the tabhost is meant by general to have one tab selected at all times,
how can I make it appear (UI speaking) as if the tab isn’t selected?

  • 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-26T19:14:01+00:00Added an answer on May 26, 2026 at 7:14 pm

    This is not possible AFAIK. but yes,you can set the selected tab’s color to look like it is unselected and set a blank layout over it by managing a global variable when you make it ‘unselected’ and setting up normal layout when you want it to be shown normally to user. But this is kind of a trick.

    Hope,you get my point!

    EDIT :

    Suppose you have set String what="disappear" somewhere in your code to show it ‘unselected’,then you can use this function to change color of tab:

    Main.class:

    //Change The Backgournd Color of Tabs
        public void setTabColor(TabHost tabhost) {
    
    
            for(int i=0;i<tabhost.getTabWidget().getChildCount();i++)
            {
                    tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FFFFFF"))); //unselected white colored                   
            }
    
                if(!what.equals("disappear"))
                     tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("FF0000"))); // selected red colored
    
                else
                     tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("FFFFFF"))); // selected but show as unselected with white color
    
    
        }
    

    And in your activity class(which is opened by that selected tab):

    FirstActivity.class:

    if(what.equals("disappear"))
          setContentView(R.layout.blank);
    else
          setContentView(R.layout.first_layout);
    

    blank.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:id="@+id/layout"
      android:background="#ffffff"  
      android:gravity="center">
      <!-- You can make background transperent by setting it to "00ffffff" -->
      <!-- You can also add this textview to guide user -->
      <!--
          <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="Click Any Tab To Start
             />
      -->
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tabhost with two tabs. Each tab has his own activity. My
I have a tabhost with 4 tabs. Each tab has several editboxes. On real
I need to have a TabHost consisting of two tabs where each tab represented
I have problem with initializing TabHost. I need to have in View several Tabs
I have three tabs in a tabhost. I can switch between the three tabs.
I have an application with various tabs (on a tabhost), each tab is an
I have tabhost with 4 tabs. If I (for example) open tab #3, start
I have a tabhost with some tabs, and each tab have implemented the method
I have a Tabhost and in that tabhost there are 4 tabs and in
I have TabHost with three tabs. One of these tabs contains ListActivity. I want

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.