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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:25:21+00:00 2026-05-21T11:25:21+00:00

I wrote a simple Android program with 2 tabs. Tab 1 has a button

  • 0

I wrote a simple Android program with 2 tabs. Tab 1 has a button which will open a new window. But I realized that when opening this new window, the Android tab bar will be hidden.

I’d like to always show the Android tab bar when new activity starts ie show tab bar for all activity

  • 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-21T11:25:22+00:00Added an answer on May 21, 2026 at 11:25 am

    Basicly, you need to create framelayout, which will host your new activities.

    Here is tabs.xml

    <?xml version="1.0" encoding="utf-8"?>
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:orientation="vertical"
        android:layout_height="fill_parent">
       <ScrollView
          android:id="@+id/ScrollView01"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:scrollbars="vertical"
          android:background="@drawable/bbg">
          <LinearLayout
             android:orientation="vertical"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent">
             <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#000000"/>
             <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"/>
          </LinearLayout>
       </ScrollView>
    </TabHost>
    

    And here is TabsActivity:

       @Override
       public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.tabs);
    
          Resources res = getResources(); 
          TabHost tabHost = getTabHost();  
          TabHost.TabSpec spec;  
          Intent intent;  
          intent = new Intent().setClass(this, RegistrationActivity.class);
          spec = tabHost.newTabSpec("registration").setIndicator("Регистрация",
                            res.getDrawable(R.drawable.ic_tab_registration))
                            .setContent(intent);
          tabHost.addTab(spec);
          intent = new Intent().setClass(this, LoginActivity.class);
          spec = tabHost.newTabSpec("login").setIndicator("Логин",
                res.getDrawable(R.drawable.ic_tab_login))
            .setContent(intent);
          tabHost.addTab(spec);
          tabHost.setCurrentTab(0);
    
    
       }
    

    this example will create 2 tabs, and 2 activities. Tap on any tap will start activity. Tabs will be always on top of screen.

    UPD.

    ActivityGroups may help you
    http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/

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

Sidebar

Related Questions

I wrote a simple Android program with 2 tabs. Tab 1 has a button
I wrote simple aplication for android. It works great in emulator. But when I
I wrote simple code for deleting all entries from android calendar,but it didn't delete
I just wrote a simple DirectShow Filter (which inherits from CTransformFilter). But I want
I wrote a simple Windows Forms program in C#. I want to be able
I wrote a simple web service in C# using SharpDevelop (which I just got
I wrote a simple javascript image rotator which picks a random image on each
I am developing a simple android application using eclipse. I wrote a JUnit TestCase
I am writing a simple Android app and have a database that will send
I wrote a simple loop to aid in billboarding that will check if a

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.