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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:36:20+00:00 2026-05-26T02:36:20+00:00

I am developing one application which will send the request to server and get

  • 0

I am developing one application which will send the request to server and get the response with data and then launch the homepage with the updated data.

I am using following approach:

  1. create handler in UI side and subscribe with the service.
  2. after subscribing with the service, send request to the server via service.
  3. service received the data and update the data in the registered handler.

Problem:
My observation is my homepage is getting launched with the default value so it seems like before getting subscribe with the service ,Ui is getting launched.

I want to restrict homepage display with default value, when response come from server with the data then only it should display with the updated data.
OR
it should display busy dialog until homepage gets updated with the received data, like how it behaves when we click on to get the weather/stock information on android phone.

So anyone could help with the appropriate approach? If someone can share with the example then it would be great for me.

Thanks,
Piks

  • 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-26T02:36:20+00:00Added an answer on May 26, 2026 at 2:36 am

    Just go through the AsyncTask, its easy to implement Threading in android, also known as Painless Threading.

    Let me explore more about AsyncTask. It provides 4 methods:

    1. doInBackground() – Perform background task here
    2. onPostExecute() – Perform Display result type of operations
    3. onProgressUpdate() – Perform update on UI based on the progress update
    4. onPreExecute() – Perform all the task which are needed before the execution of doInBackground() process, mostly we display ProgressBar(Busy dialog with Please Wait… text).

    For example:

    private class LongOperation extends AsyncTask {
    
        @Override
        protected void onPreExecute() {
           // Things to be done before execution of long running operation. For example showing ProgessDialog
        }
    
        @Override
        protected String doInBackground(String... params) {
           // perform long running operation operation
          return null;
        }
    
        @Override
        protected void onPostExecute(String result) {
          // execution of result of Long time consuming operation
        }
    
        @Override
        protected void onProgressUpdate(Void... values) {
          // Things to be done while execution of long running operation is in progress. For example updating ProgessDialog
        }
    }
    

    Now you can execute AsyncTask as:

    new LongOperation().execute(params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing one GPS Application. Which will send the location data to server
I'm developing an application via which one can send sms by directing it to
I am developing one iPhone application where I need to send some data (in
Hai every one I am developing an windows application in which i have to
I'm developing an application which will have these classes: class Shortcut { public string
I am planning on developing .NET web application which also will be accessed from
I am developing a Cocoa application which involves a chat element. One approach I've
I'm currently developing a C# application which will record registry changes, save them to
I'm developing an application in which 2D animations will be displayed over a live-camera
I am developing PDF to e-book converter which will run on a server. I

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.