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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:34:22+00:00 2026-05-18T12:34:22+00:00

How to add tabbar in doinbackground asynctask in android? or how to run splash

  • 0

How to add tabbar in doinbackground asynctask in android? or how to run splash screen in thread? I want to show a progress dialog or splash screen until tab bar is loaded from calling tabbar class I am calling webservices and parsing the value takes time, for few mins mean time, I have to show progessbar or splash screen. Can anybody tell me how to implement this? Can anybody give sample code?
I tried but its not working

dlg = ProgressDialog.show(this, "Working..", "Downloading Data...", true, false);    

 Thread splashThread = new Thread() { 
        @Override
        public void run() { 
           try { 

                sleep(100000); 



           } catch (InterruptedException e) { 
              // do nothing 
           } finally { 

           } 
        } 
     }; 
     splashThread.start(); 
  • 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-18T12:34:22+00:00Added an answer on May 18, 2026 at 12:34 pm

    you cannot touch anything of the main ui thread from a background thread, in order to do that you have to use a handler who manages the synchronization between background thread and ui main thread.

    the better way is subclassing the AsyncTask, doing this, you already have methods who works on background and methods who work on the ui. With this, you can perform the background operation and inmediatly shows the result…

    public class AsynchronousTask extends AsyncTask<Runnable, String, Result> {
    
    //method executed automatically in the ui event before the background thread execution
    @Override
        protected void onPreExecute() {
            //show the splash screen and add a progress bar indeterminate
        }
    
    //method executed automatically in the ui event AFTER the background thread execution
    @Override
        protected void onPostExecute(Result result) {
            //hide the splash screen and drop the progress bar or set its visibility to gone.
        }
    
    //method executed in a background event when you call explicitly execute...
    @Override
        protected Result doInBackground(Runnable... tasks) {
    Result result;
            if(tasks != null && tasks.length > 0){
                for (Runnable runnable : tasks) {
                    //publishProgress( ... );
                    runnable.run();
                                    //result = ...
                    //publishProgress( ...);
                }
            }
            return result;
        }
    
    }
    

    http://developer.android.com/reference/android/os/AsyncTask.html

    read more here
    hope this helps…

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

Sidebar

Related Questions

I want to add a tab to a certain tab bar from inside the
I want to add a view under my tab bar analog in iOS and
in my viewcontroller,I want to add the uitabbar UITabBar *tabBar = [[UITabBar alloc]initWithFrame:CGRectMake(0, 410,
I have a TabBar Control with 3 tab, i need to add controls(Button,Label) dynamically
As i am newbie i want to add navigation controller with tabbar controller and
I have a tabbar app and I want to add login window that will
i want to create tabbar based application..but i want tab bar should be above
Just like the Dropbox app for iPad I want to add Tabbar in the
i have a tabbar app with 4 tabs. i want to add a small
How do I add a third tab bar item to a tab bar 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.