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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:26:25+00:00 2026-05-19T05:26:25+00:00

This is my first tabbed application for Android. I walked through the HelloTabWidget app

  • 0

This is my first tabbed application for Android. I walked through the “HelloTabWidget” app on androids website, but I can’t figure out how to add content to the tabs. The FrameLayout stacks stuff on top of each other to the top left (from what I’ve read). I added a couple of textviews and an imageView, but it only displays the last item added. Is there a way to use Linear Layout instead of Frame Layout? If not, how can you place multiple views in the tab? The only thing I have done different from the example is I added a 4th tab. In one of the tab Activities I inserted the following code to try to get multiple items to display:

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);    

        TextView textview = new TextView(this);
        textview.setText("This is the About tab");
        setContentView(textview);

        TextView textview2 = new TextView(this);
        textview2.setText("About Test");
        setContentView(textview2);

        ImageView imgView = new ImageView(this);
        imgView.setImageDrawable(getResources().getDrawable(R.drawable.header));
        setContentView(imgView);
    }

Here is the link to the example I followed:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

  • 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-19T05:26:26+00:00Added an answer on May 19, 2026 at 5:26 am

    What is your layout xml file? I use this and I can stack several textview in every tab. TabActivity:

    <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">
        <ScrollView android:layout_width="fill_parent" 
            android:layout_height="wrap_content" >
            <LinearLayout android:layout_width="fill_parent" 
                android:layout_height="fill_parent"
                android:orientation="vertical" >
                <TabWidget android:id="@android:id/tabs"
                    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>
        </ScrollView>
    </TabHost>
    

    Activity inside tab:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <TextView android:id="@+id/textOne" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
        <TextView android:id="@+id/textTwo" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    <LinearLayout>
    

    I’m a newbie myself, so there might be a better way to do it. This works for me, though.

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

Sidebar

Related Questions

You can actually just skip this first part cause it gets confusing, but I'll
problem euler #5 i found the solution but i don't know why this first
this is my first question here so I hope I can articulate it well
I have this very basic tabbed block: $('.tabbed-section .panel').hide(); $('.tabbed-section .panel:first').show(); $('.tabbed-section .tabs li:first').addClass('active');
I have this code for a Tabbed area, but when a user clicks a
I'm attempting to display a tabbed panel but the tabs are not displaying. This
Hi I'm setting up an android app and I'm using a tabbed interface. I'd
This is my first post here and I wanted to get some input from
This is my first experience using the Zend Framework. I am attempting to follow
this is my first question to stackoverflow so here it goes... I use cruise

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.