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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:36:56+00:00 2026-06-16T15:36:56+00:00

I have a simple Tablayout for four activites. This is it’s xml <?xml version=1.0

  • 0

I have a simple Tablayout for four activites.
This is it’s 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:layout_height="fill_parent"

    >
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">


        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:background="@drawable/bg1"
            />
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:layout_weight="0"
            android:layout_marginBottom="-4dp"
            />
    </LinearLayout>
</TabHost>

When it starts the activity connected to tab0 starts by default

What I need is to create start layout before any activity starts to look like the following
! [] http://i49.tinypic.com/2ugf3op.png

I don’t know where I should put the layout of the 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-06-16T15:36:57+00:00Added an answer on June 16, 2026 at 3:36 pm

    By default in android, always the first tab is selected by default. What you can do to confuse the user that nothing is selected is that you change the drawables of the tabs. Make all tabs unselected by default, and in the frame layout you set the content as in image. Then as soon as the user clicks on the tab then change the color of that tab and then start the activity. The activity connected to tab0 will start by default always. But you can make a check condition there, that if the user has not clicked on anything then display some empty screen with background or otherwise start the activity.

    UPDATE
    By default open up some empty activity with some views according to your wish. This will be shown as soon as the user opens up the activity with the tabs. Then you can implment OnTabChangeListener on that activity and overide the onTabChanged()

      public void onTabChanged(String tabId) {
                if (tabId.equals("TAB 0")) {
                      // Show your actual activity here
                } 
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tabLayout where main.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:layout_height=fill_parent>
I have simple front controller plugin which contains this code: http://pastebin.com/m155c59b0 When session expire
I'm new, so sorry if this turns out so simple that I should have
My splash screen for my (very simple) Android application isn't showing. I have no
I saw this link (http://stackoverflow.com/questions/6603868/android-onclicklistener-and-table-layout) which seems like it works for the person asking
I have a simple table layout in the .xml file. I am adding components
I have simple form containing four textareas and a radio group with a radio
My Android app consists of a simple tablayout (3 tabs). Let's say the user
I have a simple problem for Android. I'd like to create an n by
Have simple Spring Security webapp with password encoding: <security:authentication-manager alias=authenticationManager> <security:authentication-provider user-service-ref=personService> <security:password-encoder hash=md5

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.