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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:57:45+00:00 2026-06-16T18:57:45+00:00

ok, so i have a tabhost with 4 tabs. each one of these tabs

  • 0

ok, so i have a tabhost with 4 tabs. each one of these tabs has buttons, 2 of these tabs have scrollviews. all of my tabs are hosted within the same xml file. it seems like my xml runs like a script because only my last tab’s scrollview works and only the buttons on my last tab work. i ready a StackOverflow review that mentioned hosting each tab in its own xml file but i tried with no luck. i dont know if i just didnt code it properly or what. If someone could please help let me know!

XML

<TabHost
    android:id="@+id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
        </TabWidget>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <RelativeLayout
                android:id="@+id/tab1"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <TextView
                    android:id="@+id/tvOffice"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="Office Location"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvOfficeLocation"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvOffice"
                    android:text="Smart Technologies, Inc. is currently located at:"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvOfficeAdd1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvOfficeLocation"
                    android:text="201 South Eagle Lane"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvOfficeAdd2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvOfficeAdd1"
                    android:text="Smart Technologies, Inc. is currently located at:"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvMap"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvOfficeAdd2"
                    android:text="View Map"
                    tools:ignore="HardcodedText" />
                <Button
                    android:id="@+id/bMap"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvMap"
                    android:text="Map"
                    tools:ignore="HardcodedText" />
                <TextView
                    android:id="@+id/tvPhone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/bMap"
                    android:text="Contact Phone Numbers"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold"
                    tools:ignore="HardcodedText" />

                <Button
                    android:id="@+id/bCallOffice"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvPhone"
                    android:text="Call Office"
                    tools:ignore="HardcodedText" />

                <Button
                    android:id="@+id/bCallTollFree"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/bCallOffice"
                    android:text="Call Toll Free"
                    tools:ignore="HardcodedText" />


            </RelativeLayout>

            <ScrollView
                android:id="@+id/scrollView1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" >

                <RelativeLayout
                    android:id="@+id/tab2"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >

                    <ImageView
                        android:id="@+id/ivStef"
                        android:layout_width="208dp"
                        android:layout_height="208dp"
                        android:layout_alignParentLeft="true"
                        android:contentDescription="Stef"
                        android:src="@drawable/yellow_bird_icon"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvStef"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/ivStef"
                        android:text="Stephaine Smith"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvStefTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvStef"
                        android:text="Sales"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bCallStef"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvStefTitle"
                        android:text="Call Stephanie"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bEmailStef"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/bCallStef"
                        android:text="Email Stephanie"
                        tools:ignore="HardcodedText" />

                    <ImageView
                        android:id="@+id/ivGRay"
                        android:layout_width="208dp"
                        android:layout_height="208dp"
                        android:layout_alignParentLeft="true"
                        android:layout_below="@+id/bEmailStef"
                        android:contentDescription="G Ray"
                        android:src="@drawable/green_bird_icon"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvGRay"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/ivGRay"
                        android:text="Gerald Ray"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvGRayTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvGRay"
                        android:text="Sales/RCDD"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bCallGRay"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvGRayTitle"
                        android:text="Call Gerald"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bEmailGRay"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/bCallGRay"
                        android:text="Email Gerald"
                        tools:ignore="HardcodedText" />
                </RelativeLayout>
            </ScrollView>

            <RelativeLayout
                android:id="@+id/tab3"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <ImageView
                    android:id="@+id/ivJeremy"
                    android:layout_width="208dp"
                    android:layout_height="208dp"
                    android:layout_alignParentLeft="true"
                    android:contentDescription="Jeremy"
                    android:src="@drawable/red_bird_icon"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvJeremy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/ivJeremy"
                    android:text="Jeremy Walck"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tvJeremyTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvJeremy"
                    android:text="Cabling Supervisor/ Vice President"
                    tools:ignore="HardcodedText" />

                <Button
                    android:id="@+id/bCallJeremy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvJeremyTitle"
                    android:text="Call Jeremy"
                    tools:ignore="HardcodedText" />

                <Button
                    android:id="@+id/bEmailJeremy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/bCallJeremy"
                    android:text="Email Jeremy"
                    tools:ignore="HardcodedText" />
            </RelativeLayout>

            <ScrollView
                android:id="@+id/scrollView3"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" >

                <RelativeLayout
                    android:id="@+id/tab4"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >

                    <ImageView
                        android:id="@+id/ivJerry"
                        android:layout_width="208dp"
                        android:layout_height="208dp"
                        android:layout_alignParentLeft="true"
                        android:contentDescription="Jerry"
                        android:src="@drawable/black_bird_icon"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvJerry"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/ivJerry"
                        android:text="Jerry Hedrick"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvJerryTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvJerry"
                        android:text="Network Administrator / Vice Presedent"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bCallJerry"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvJerryTitle"
                        android:text="Call Jerry"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bEmailJerry"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/bCallJerry"
                        android:text="Email Jerry"
                        tools:ignore="HardcodedText" />

                    <ImageView
                        android:id="@+id/ivTanner"
                        android:layout_width="208dp"
                        android:layout_height="208dp"
                        android:layout_alignParentLeft="true"
                        android:layout_below="@+id/bEmailJerry"
                        android:contentDescription="Tanner"
                        android:src="@drawable/blue_bird_icon"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvTanner"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/ivTanner"
                        android:text="Tanner Hughes"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText" />

                    <TextView
                        android:id="@+id/tvTannerTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvTanner"
                        android:text="Network Administrator"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bCallTanner"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/tvTannerTitle"
                        android:text="Call Tanner"
                        tools:ignore="HardcodedText" />

                    <Button
                        android:id="@+id/bEmailTanner"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/bCallTanner"
                        android:text="Email Tanner"
                        tools:ignore="HardcodedText" />
                </RelativeLayout>
            </ScrollView>
        </FrameLayout>
    </LinearLayout>
</TabHost>

Java

public class Contact extends Activity implements View.OnClickListener {

TabSpec specs, specs2, specs3, specs4;
Button cStef, eStef, cGRay, eGRay, cJeremy, eJeremy, cJerry, eJerry,
        cTanner, eTanner, cOffice, cTollFree, MapOffice;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    // fullScreen
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.contact);
    TabHost th = (TabHost) findViewById(R.id.tabhost);
    th.setup();
    // tab2 setup
    specs = th.newTabSpec("office");
    specs.setContent(R.id.tab1);
    specs.setIndicator("Office");
    th.addTab(specs);
    // tab2 setup
    specs2 = th.newTabSpec("sales");
    specs2.setContent(R.id.tab2);
    specs2.setIndicator("Sales");
    th.addTab(specs2);
    // tab2 setup
    specs3 = th.newTabSpec("cabling");
    specs3.setContent(R.id.tab3);
    specs3.setIndicator("Cabling");
    th.addTab(specs3);
    // tab3 setup
    specs4 = th.newTabSpec("service");
    specs4.setContent(R.id.tab4);
    specs4.setIndicator("Service");
    th.addTab(specs4);
    initialize();

}

private void initialize() {
    // TODO Auto-generated method stub
    MapOffice = (Button) findViewById(R.id.bMap);
    cOffice = (Button) findViewById (R.id.bCallOffice);
    cTollFree = (Button) findViewById (R.id.bCallTollFree);
    cStef = (Button) findViewById(R.id.bCallStef);
    eStef = (Button) findViewById(R.id.bEmailStef);
    cGRay = (Button) findViewById(R.id.bCallGRay);
    eGRay = (Button) findViewById(R.id.bEmailGRay);
    cJeremy = (Button) findViewById(R.id.bCallJeremy);
    eJeremy = (Button) findViewById(R.id.bEmailJeremy);
    cJerry = (Button) findViewById(R.id.bCallJerry);
    eJerry = (Button) findViewById(R.id.bEmailJerry);
    cTanner = (Button) findViewById(R.id.bCallTanner);
    eTanner = (Button) findViewById(R.id.bEmailTanner);


    MapOffice.setOnClickListener(this);
    cOffice.setOnClickListener(this);
    cTollFree.setOnClickListener(this);
    cStef.setOnClickListener(this);
    eStef.setOnClickListener(this);
    cGRay.setOnClickListener(this);
    eGRay.setOnClickListener(this);
    cJeremy.setOnClickListener(this);
    eJeremy.setOnClickListener(this);
    cJerry.setOnClickListener(this);
    eJerry.setOnClickListener(this);
    cTanner.setOnClickListener(this);
    eTanner.setOnClickListener(this);

}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    final Intent callOffice = new Intent(Intent.ACTION_CALL);
    callOffice.setData(Uri.parse("tel:4057877878"));

    switch (v.getId()) {
    //Tab 1
    case R.id.bMap:

        break;
    case R.id.bCallOffice:
        startActivity(callOffice);
        finish();

        break;
    case R.id.bCallTollFree:
        Intent callToll = new Intent(Intent.ACTION_CALL);
        callToll.setData(Uri.parse("tel:18006461423"));
        startActivity(callToll);
        finish();

        break;

    // Tab 2
    case R.id.bCallStef:
        startActivity(callOffice);
        finish();

        break;
    case R.id.bEmailStef:
        Intent emailStef = new Intent(Intent.ACTION_SEND);
        emailStef.putExtra(Intent.EXTRA_EMAIL,
                new String[] { "ssmith@smart-technologies.com" });
        emailStef
                .putExtra(Intent.EXTRA_TEXT,
                        "This Email was sent by the Smart Technologies Android Application");
        emailStef.setType("text/plain");

        startActivity(emailStef);
        finish();

        break;
    case R.id.bCallGRay:
        startActivity(callOffice);
        finish();

        break;
    case R.id.bEmailGRay:
        Intent emailGRay = new Intent(Intent.ACTION_SEND);
        emailGRay.putExtra(Intent.EXTRA_EMAIL,
                new String[] { "Gray@smart-technologies.com" });
        emailGRay
                .putExtra(Intent.EXTRA_TEXT,
                        "This Email was sent by the Smart Technologies Android Application");
        emailGRay.setType("text/plain");
        startActivity(emailGRay);
        finish();

        break;
    // Tab 3
    }
    switch (v.getId()) {
    case R.id.bCallJeremy:
        startActivity(callOffice);
        finish();
        break;
    case R.id.bEmailJeremy:
        Intent emailJeremy = new Intent(Intent.ACTION_SEND);
        emailJeremy.putExtra(Intent.EXTRA_EMAIL,
                new String[] { "jwalck@smart-technologies.com" });
        emailJeremy
                .putExtra(Intent.EXTRA_TEXT,
                        "This Email was sent by the Smart Technologies Android Application");
        emailJeremy.setType("text/plain");
        startActivity(emailJeremy);
        finish();

        break;

    // Tab 4
    }
    switch (v.getId()) {
    case R.id.bCallJerry:
        startActivity(callOffice);
        finish();

        break;

    case R.id.bEmailJerry:
        Intent emailJerry = new Intent(Intent.ACTION_SEND);
        emailJerry.putExtra(Intent.EXTRA_EMAIL,
                new String[] { "jhedrick@smart-technologies.com" });
        emailJerry
                .putExtra(Intent.EXTRA_TEXT,
                        "This Email was sent by the Smart Technologies Android Application");
        emailJerry.setType("text/plain");
        startActivity(emailJerry);
        finish();

        break;

    case R.id.bCallTanner:
        startActivity(callOffice);
        finish();
        break;

    case R.id.bEmailTanner:
        Intent emailTanner = new Intent(Intent.ACTION_SEND);
        emailTanner.putExtra(Intent.EXTRA_EMAIL,
                new String[] { "thughes@smart-technologies.com" });
        emailTanner
                .putExtra(Intent.EXTRA_TEXT,
                        "This Email was sent by the Smart Technologies Android Application");
        emailTanner.setType("text/plain");
        startActivity(emailTanner);
        finish();

        break;

    }

}

}

  • 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-16T18:57:46+00:00Added an answer on June 16, 2026 at 6:57 pm

    The problem with multiple scrollviews is that only one is focusable.
    i once created an application with several scrollviews

    and on a buttonclick i changed the visibility and the focusability of the view like this

    public void buttonShowRankingClicked(final View v){   
        rankingScrollView.setVisibility(View.VISIBLE);
        rankingScrollView.setFocusable(true);
        rankingScrollView.setClickable(true);
    
        teaminfoScrollView.setVisibility(View.GONE);
        teaminfoScrollView.setFocusable(false);
        teaminfoScrollView.setClickable(false);
    }
    

    This way the other ScrollView will get visible and you can scroll 🙂

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

Sidebar

Related Questions

I have a tabhost with two tabs. Each tab has his own activity. My
I have a tabhost with 4 tabs. Each tab has several editboxes. On real
I have TabHost with three tabs. One of these tabs contains ListActivity. I want
I have a tabHost, with to tabs and an activity each one of them.
I'm trying to work with Tabhost, I have 2 tabs, each one loads one
I have a TabActivity that has a TabHost with two tabs. Each tab has
I have a tabhost with 3 tabs. In each of these tabs there is
Currently I have a TabHost implemented with 3 tabs each containing a separate activity.
I have one activity in which I am having one TabHost with two tabs.
I have a tabhost with three tabs. Each is an activity. I would like

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.