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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:16:11+00:00 2026-05-16T18:16:11+00:00

I have three tabs and each one is its own activity. When I switch

  • 0

I have three tabs and each one is its own activity. When I switch tabs I want my Spinner to update but I don’t know what method gets called on tab switch. Any help?

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

    Hook up a listener to the TabHost.OnTabChangeListener. You main activity extends TabActivity and its onCreate method probably looks something like this:

        @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TabHost tabHost = getTabHost();
    
        LayoutInflater.from(this).inflate(R.layout.tabs1, tabHost.getTabContentView(), true);
    
        tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("tab1")
                .setContent(R.id.view1));
        tabHost.addTab(tabHost.newTabSpec("tab3")
                .setIndicator("tab2")
                .setContent(R.id.view2));
        tabHost.addTab(tabHost.newTabSpec("tab3")
                .setIndicator("tab3")
                .setContent(R.id.view3));
    }
    

    To hook up the listener, add the following code in your onCreate() method:

        tabHostt.setOnTabChangedListener(new OnTabChangeListener(){
        @Override
        public void onTabChanged(String tabId) {
            if(tabId.equals("tab1")) {
                //tab1
            }
            else if(tabId.equals("tab2")) {
                //tab2
            }
            else if(tabId.equals("tab3")) {
                //tab3
            }
        }
    });
    

    HTH

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

Sidebar

Related Questions

In my project I have three tabs. I want to know, each time that
I have three tabs on page and one user control. I want to RenderPartial
I have TabHost with three tabs. One of these tabs contains ListActivity. I want
I have a UITabBarController with three tabs: each is a navigation controller with a
I am adding some tabs to the stage, and each tab loads its own
Here is the scenario: I have an activity with 4 tabs, each tab with
I have three monitors. I normally run one maximized xterm on each monitor, attached
I have three tabs. When I press the tab button on the bottom, is
I am using jquery UI tabs I have three ajax tabs like so: <div
I have a TabActivity with three tabs defined. The first tab is light-weight and

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.