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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:22:54+00:00 2026-05-15T21:22:54+00:00

Respected All I have to add TabBar in my application, but i don’t know

  • 0

Respected All
I have to add TabBar in my application, but i don’t know how to add tab bar to application or activity. Can you help me for that.

Thank You
Vikram Kadam

  • 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-15T21:22:55+00:00Added an answer on May 15, 2026 at 9:22 pm

    You have to use a TabHost.
    You can find a clear example here. Read the tuto for the explanations, here below you have just the code.
    In short :
    you need an xml file with some layout for each tab, and an activity to display the tabs :
    In your xml tabs.xml :

    http://schemas.android.com/apk/res/android”
    android:orientation=”vertical”
    android:layout_width=”fill_parent”
    android:layout_height=”fill_parent”
    >

    <TabHost
    id=”@+id/tabs”
    android:layout_width=”fill_parent”
    android:layout_height=”fill_parent”
    >
    
    <TabWidget
    id=”@android:id/tabs”
    android:layout_width=”wrap_content”
    android:layout_height=”wrap_content”
    />
    <FrameLayout
    id=”@android:id/tabcontent”
    android:layout_width=”fill_parent”
    android:layout_height=”200px”
    android:paddingTop=”30px”
    >
    <LinearLayout
    id=”@+id/content1″
    android:orientation=”vertical”
    android:layout_width=”fill_parent”
    android:layout_height=”fill_parent”
    android:background=”#ff99ccff”
    >
    <TextView
    android:layout_width=”fill_parent”
    android:layout_height=”wrap_content”
    android:text=”tab item uno :) ”
    />
    </LinearLayout>
    <LinearLayout
    id=”@+id/content2″
    android:orientation=”vertical”
    android:layout_width=”fill_parent”
    android:layout_height=”fill_parent”
    android:background=”#ffffcc99″
    >
    <TextView
    android:layout_width=”fill_parent”
    android:layout_height=”wrap_content”
    android:text=”tab item dos :/”
    />
    <Button
    android:layout_width=”fill_parent”
    android:layout_height=”wrap_content”
    android:text=”tabhost needs”
    />
    <Button
    android:layout_width=”fill_parent”
    android:layout_height=”wrap_content”
    android:text=”to be upgraded ;) ”
    />
    </LinearLayout>
    </FrameLayout>
    </TabHost>
    </LinearLayout>
    

    In the onCreate method of your activity :

    setContentView(R.layout.tabs);
    
    TabHost tabs = (TabHost)this.findViewById(R.id.tabs);
    tabs.setup();
    
    tabs.addTab(“one”, R.id.content1, “labelone”);
    tabs.addTab(“two”, R.id.content2, “labeltwo”);
    

    Thanks Jeff for the tuto

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

Sidebar

Related Questions

I have a tab bar controller with different view controllers all using the same
All respected, I have a Master detail project asp.net (sql data) project in which
Respected sir/madam, I have a fortran exe which takes a input file and produces
I know this is repeated question on Stack. But in my case the URL
I have about 10 different entities in my J2EE application that right now share
i have a news reader app. i want to add IAP to my app.
I'm trying to add or subtract some days to inputs that I have. In
I have a query that needs to check that all fields have values are
I am simplifying a little here: I have a tab control, and should like
I have a library project, it contains all resources and class files, this project

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.