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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:07:40+00:00 2026-06-04T23:07:40+00:00

I have 3 tabs contain different contents. They loads content from Internet. I use

  • 0

I have 3 tabs contain different contents. They loads content from Internet. I use 3 AsyncTasks to do it.
At the beginning, 3 tabs show 3 ProgressBar. I want that everytime one task finishs, it updates the TabSpec and hide the ProgressBar.
The problem is I don’t know how to update the tab spec.

This is my snippet to create TabHost at the beginnig.

    final List<View> containerList = new ArrayList<View>();
    for(int i = 0; i < 4; ++i) {
        final LinearLayout layout = new LinearLayout(this);
        final ProgressBar progressBar = new ProgressBar(this);
        progressBar.setVisibility(View.VISIBLE);
        layout.addView(progressBar);            
    }

    // Prepare labels and icons.        
    final List<String> tabLabels = Arrays.asList(getResources().getStringArray(R.array.destination_tab_labels));       
    // TODO Prepare icons here later.

    // Populate tabs' contents.
    final TabHost tabHost = getTabHost();
    for(final String label : tabLabels) {
        final TabSpec tab = tabHost.newTabSpec(label);
        tab.setContent(new TabContentFactory() {
            @Override
            public View createTabContent(final String tag) {
                // Return ListView here later.
                return containerList.get(i++);
            }
        });
        //TODO Add icon here later.
        tab.setIndicator(label);
        tabHost.addTab(tab);
    }
  • 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-04T23:07:42+00:00Added an answer on June 4, 2026 at 11:07 pm

    create 3 activities each with its own content, AsyncTask and progressbar. For any activity as the task finishes it will update its content and hide the progressbar.
    Add these 3 activites to the tab host like ::

    TabHost host = getTabHost(); 
    host.addTab(host.newTabSpec("one").setIndicator("TAB1").setContent(new Intent(this, MyActivity1.class)));
    host.addTab(host.newTabSpec("two").setIndicator("TAB2").setContent(new Intent(this, MyActivity2.class)));
    host.addTab(host.newTabSpec("two").setIndicator("TAB2").setContent(new Intent(this, MyActivity3.class)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several tabs in my application, and each tab loads a different sub-page
I have 3 different tabs where i am displaying data using jQGrids(each tab contain
At present I have some jQuery tabs and these tabs contain links. Unfortunately on
I have an app which has a UITabBarController, and when different tabs are pressed,
I have a fragment interface with tabs along the bottom which open different fragments
I have several tabs. Each tab has several nested elements that contain checkbox input
I have a popup that contains tabs, my problem is that they do not
I'm using jQuery UI tabs, loading the tab content via ajax. Content may contain
I want to use Jquery UI Tabs to make three tabs that all contain
I have a form split apart throughout 4 tabs. One of the tabs contains

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.