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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:23:57+00:00 2026-06-11T21:23:57+00:00

In OnResume() , I make web service call in thread here i used progress

  • 0

In OnResume(), I make web service call in thread here i used progress bar for indicating the process it works fine but suppose i uses the app after sometime i put the device idle after that open the app once again this time progress bar is not dismissed.It’s not regularly happens sometimes it happens. Why?
How can i make it to away from this? If you need more info plz let me know.

Code :

Edit:

public void onResume()
{

    super.onResume();
    pdMessages = ProgressDialog.show(getParent(), "", "Please wait...", true);
            Thread thImportbtn = new Thread() 
            {
                public void run() 
                {
                    try
                    {
                        //Get internal messages
                        strInternalInboxWSR = GetInternalInboxMessages();


                    } catch (SoapFault e) {
                        e.printStackTrace();
                    }   

                    dh_Messages_Handler.post(checked_internalinbox_response);
                    handler.sendMessage(handler.obtainMessage());
                }                                               
            };
            thImportbtn.start();       
}

private Handler handler = new Handler()
{

@Override
public void handleMessage ( Message message )
{
    pdMessages.dismiss();
}

};

  • 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-11T21:23:58+00:00Added an answer on June 11, 2026 at 9:23 pm

    You are Trying To Dismiss ProgressDialog in Non-UI Thread, So can’t Dismiss proper.

    you should put your dismiss code( pdMessages.dismiss();) in Handler Using Overriding handleMessage method

    Use AsyncTask is better.

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

Sidebar

Related Questions

The program works fine when I delete out the onResume() method but when I
I need to restart a timer on onResume() because on onPause() I call timer.cancel()
Here is how my app is laid out: onResume() user is prompted to login
I'm tryng to make my Android app register a service via zeroconf while the
I'm trying to make a simple sudoku but I have a problem with the
So I have my onResume command restarting a stopped thread which runs my game
In onResume() I do: registerReceiver(timeTickReceiver, new IntentFilter(Intent.ACTION_TIME_TICK)); and in onPause(): unregisterReceiver(timeTickReceiver); I see java.lang.IllegalArgumentException:
Problem: Fragment onResume() in ViewPager is fired before the fragment becomes actually visible. For
I'm registering for location updates: public void onResume() { LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); List<String>
How are events like onPause, onResume etc for Android Activity taken care of in

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.