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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:55:47+00:00 2026-06-10T00:55:47+00:00

I have a simple app (tabs with Fragment contents) obtained by extending this sample:

  • 0

I have a simple app (tabs with Fragment contents) obtained by extending this sample: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html.

One of those tabs needs to have a ListView and after clicking an item, details should be displayed on another screen, if the screen is small, or on the same screen, if it’s large (or in landscape mode).

I’ve tried to integrate this sample here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.html, but that one’s an activity, not a Fragment, so I can’t use:

setContentView(R.layout.fragment_list_layout);

LE more details:

I have a FragmentActivity with a TabHost whose contents are Fragments. One of those Fragments will have to be a ListFragment that can display the details on the same screen as the list, such as this sample from FragmentLayout.java:

enter image description here

I want to get to this functionality using the recommended practices (Fragments as tab contents). Is this possible?

If not, I’ve tried and managed to start another FragmentActivity when a certain tab is selected. The goal is to use that FragmentActivity as a container for my layout (ListView + fragment) just like in the FragmentLayout example, except that I can’t seem to add the previously created tab menu to it. How to get this working then?

Currently:

enter image description here

After selecting “random tab”:

enter image description here

My last resort desired look (separate FragmentActivity with the original tabHost):

enter image description here

  • 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-10T00:55:48+00:00Added an answer on June 10, 2026 at 12:55 am

    I’ve solved the problem by having two containers inside my tabContent, one for the ListView fragment and one for the details fragment. Here is my layout now:

    <HorizontalScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        android:scrollbars="vertical" >
    
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" />
    </HorizontalScrollView>
    
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_weight="0" />
    
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:baselineAligned="false"
        android:fadingEdge="none" >
    
        <FrameLayout
            android:id="@+android:id/realtabcontent"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="1" />
    
        <FrameLayout
            android:id="@+android:id/details_container"
            android:layout_width="0px"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:visibility="gone" />
    </LinearLayout>
    

    Tabs can be handled normally after this.

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

Sidebar

Related Questions

This is a real newbie question. I have simple app that selects a picture
I have a simple app where you can login it looks like this: {{#view
I have a simple app with a full screen UIWebView. This contains HTML generated
My Android app consists of a simple tablayout (3 tabs). Let's say the user
I have a simple app I coded for android that I want to go
I have an app with 2 tabs. Each tab has it's respective fragment. On
I have an Android app where i'm using tabs (with ActionBarSherlock). So my main
I have simple Sinatra app. web.rb: require 'sinatra' get '/' do Hello end Gemfile:*
I have one simple app that suppose to get information from user and send
I have a simple app that will allow a user to tag a location.

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.