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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:03:27+00:00 2026-05-25T13:03:27+00:00

I have 3 tabs in my TabHost like you can see TabHost th =

  • 0

I have 3 tabs in my TabHost like you can see

  TabHost th = (TabHost) findViewById(R.id.tabhost);
    th.setup();
    TabSpec specs = th.newTabSpec("Comunidade");
    specs.setContent(R.id.tab1);
    specs.setIndicator("Comunidade");
    th.addTab(specs);
    specs = th.newTabSpec("Notícias");
    specs.setContent(R.id.tab2);
    specs.setIndicator("Notícias");
    th.addTab(specs);
    specs = th.newTabSpec("Web");
    specs.setContent(R.id.tab3);
    specs.setIndicator("Web");
    th.addTab(specs);

When the application starts the initial tab is “Comunidade” with a listView, so what i want is when i click on a item’s list the View goes to the tab “Web” .

Here is the method :

 listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> av, View v, int pos, long id) {

   ourweb.loadUrl(listadesites.get(pos).getEndereço());
   //CODE THAT I NEED
        }
    });

Thanks in advance.

  • 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-25T13:03:28+00:00Added an answer on May 25, 2026 at 1:03 pm

    Use TabHost.setCurrentTab, like this:

        TabHost th = (TabHost) findViewById(android.R.id.tabhost);
        th.setCurrentTab(2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whan I have got a tabhost and impolement the tabs. How I can get
I have three tabs in a tabhost. I can switch between the three tabs.
I have a tabhost with three tabs. Each is an activity. I would like
I have a custom TabHost that adds tabs like this private void setTab(View view,
I have created four tabs using tabhost, and placed four listviews in each like
I have a tabhost with two tabs. Each tab has his own activity. My
I have an app that uses a TabHost. Several of the Tabs share a
I have an application with various tabs (on a tabhost), each tab is an
I have a layout with a TabHost/TabWidget like this: The blue box is a
I have a TabHost, and each of my tabs are individual views which look

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.