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

The Archive Base Latest Questions

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

I have started currently an portfolio application for HoneyComb tablet. I have used ActionBar.Tab

  • 0

I have started currently an portfolio application for HoneyComb tablet. I have used ActionBar.Tab to implement three tab on the ActionBar and Fragment for each Tab. The three tab name About, Gallery, Settings. In the Settings ActionBar.Tab, I want to have TabHost.
That means How to have TabHost inside Fragment. Thanks in advance for your ideas!!!

  • 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-28T02:59:25+00:00Added an answer on May 28, 2026 at 2:59 am

    Have a layout with a tabhost like (assuming you define this as my_fragment_tabhost):

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical">
        <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:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent">
                <TabWidget
                        android:id="@android:id/tabs"
                        android:visibility="gone"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"/>
                <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"/>
            </LinearLayout>
        </TabHost>
    </LinearLayout>
    

    In your fragment, have a TabHost member variable and get it in the onCreateView like:

        private TabHost mTabHost;
    
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.my_fragment_tabhost, container, false);
            mTabHost = (TabHost) view.findViewById(android.R.id.tabhost);
            mTabHost.setup();//very important to call this
    
            TabHost.TabSpec tab = mTabHost.newTabSpec("my tab content");
            tab.setIndicator("my tab content")
    //... add your content by one of the tab.setContent() methods
            mTabHost.addTab(tab);
            return view;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started to learn about python and is currently reading through a script
I have started to try out noSQL databases now and are currently testing out
Currently i have started using Nick Jhonshon's bloggart on appengine, later i do want
I am developing RESTful with php. Currently I have started coding with MVC design
I currently have a recently started project in development with a 2010 target date
I currently have a WCF Service Library which will be started through a Console
I'm currently working on a school project in Eclipse (We have just started using
I have recently started applying for .Net jobs. I currently work in a sales
I have just started my career as an android programmer, and am currently relying
I have a portfolio made in C#/ASP.NET which started off small but, as it

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.