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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:33:58+00:00 2026-05-25T10:33:58+00:00

In the demo Support4Demos – API 4+ Support Demos , the Tabs and TabsPager

  • 0

In the demo Support4Demos – API 4+ Support Demos , the Tabs and TabsPager examples both extend FragmentActivity. Each tab content is itself a Fragment. No real breakthrough, TabActivity was used the same way without the introduction of Fragment.

Now suppose inside my Activity , a screen portion is a Fragment named WidgetFragment. How is it possible for WidgetFragment to contain a TabHost ? Visualize a mini TabHost contained inside an Activity.
I tried every possible way to insert a TabHost inside a Fragment not a FragmentActivity.

  • 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-25T10:33:59+00:00Added an answer on May 25, 2026 at 10:33 am

    In generally accepted practices, Tabs fit the whole screen.
    Most people (including me) are unaware the tabs can be placed anywhere like a simple view, ListView.
    The trick is to include your TabHost inside another layout. When you create the TabHost, always keep these id : tabhost , tabs , tabcontent

    In your main layout, include your tabhost.xml . Here I center the TabHost in the middle

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical">
        <!-- Fill whatever you need -->     
        <FrameLayout
            android:id="@+id/widget_fragment"
            android:layout_centerVertical="true" android:layout_centerHorizontal="true"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content">
            <include layout="@layout/tabhost" />
        </FrameLayout> 
    </LinearLayout>
    

    Look well at the Tabs and TabsPager examples in Support4Demos , the TabHost is still managed by FragmentActivity. Each tab content is a fragment. With TabActivity, it may not be possible to have a tab anywhere

    At the end, this is what it looks like

    enter image description here

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

Sidebar

Related Questions

I have a demo database with a couple of hundred tables in it. Each
Demo: http://jsfiddle.net/55ucw/1/ In any browser other than Safari or Chrome, I can tab into
demo for reference: http://greg-j.com/static-content/accordian/ When viewed in any other browser, the toggler works as
Does anyone have a demo of a jQuery accordion that cycles through content automatically
Demo: http://jsfiddle.net/rodneyrehm/nqAwm/ I've got a <div> inside another. Both are positioned absolutely. Both should
I'm struggling with getting the demo of the level 4 support library set up
This demo creates markers at random points on map: http://gmap3.net/examples/pan-to-markers.html Whats the smallest modification
http://demo.thethemefoundry.com/traction/#post-183 Which wordpress plugin is this, to have post image on the left side
any demo on using kaazing websocket with gae?
Attended an interesting demo on REST today, however, I couldn't think of a single

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.