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

  • Home
  • SEARCH
  • 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 6785643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:09:08+00:00 2026-05-26T17:09:08+00:00

Here is my code segment I am trying to dismiss dialog but it is

  • 0

Here is my code segment I am trying to dismiss dialog but it is not getting dismissed and also i don’t get any error on logcat.Please correct me where i am wrong ?

All the Log.v statement get executed.Even log.v statement after pd.dismiss() (Log.v("TAG","progress dismiss");) gets printed.

Please point my mistake or suggest some alternative way to dismiss the progressdialog.

 btnSave.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View arg0) {

                        // TODO Auto-generated method stub
                        //do something
                        } else {
                            Log.v("TAG","above progressDialog");
                            final ProgressDialog pd = new ProgressDialog(ChangePassword.this);
                            ProgressDialog.show(ChangePassword.this, "", "Loading...", false, true);
                            new Thread() {
                                public void run() {
                                    try {                               
                                        sleep(2000);
                                        Log.v("TAG","in try block");
                                    } catch (Exception e) {
                                        Log.e("tag", e.getMessage());
                                    }
                                    // dismiss the progress dialog
                                    pd.dismiss();
    //                              Log.v("TAG","progress dismiss");
                                }
                            }.start();
                            Log.v("TAG","after start");


                             public void run()
                             {
                                 try{

                                     if (!(txtOldPass.getText().toString())
                                            .equals(SetGetValues.getPassword())) {

                                        Toast.makeText(ChangePassword.this,
                                                "Invalid Old Password", Toast.LENGTH_SHORT)
                                                .show();
                                        txtOldPass.setText("");
                                        txtNewPass.setText("");
                                        txtCnfPass.setText("");
                                    } else {
                                        if (!(txtNewPass.getText().toString())
                                                .equals(txtCnfPass.getText().toString())) {
                                            Toast.makeText(ChangePassword.this,
                                                    "Re-Enter New Password",
                                                    Toast.LENGTH_SHORT).show();
                                            txtOldPass.setText("");
                                            txtNewPass.setText("");
                                            txtCnfPass.setText("");
                                        } else {
                                            try {

    handler = new Handler();
                         handler.postDelayed(new Thread (new Runnable(){
                                                JSONStringer loginuser = new JSONStringer()
                                                        .object()
                                                        .key("userid")
                                                        .value(SetGetValues.getUserid()
                                                                .trim())
                                                        .key("password")
                                                        .value(txtCnfPass.getText()
                                                                .toString().trim())
                                                        .key("oldpassword")
                                                        .value(txtOldPass.getText()
                                                                .toString().trim())
                                                        .endObject();
                                                StringEntity entity = new StringEntity(
                                                        loginuser.toString());
                                                JSONObject results = bc
                                                        .returnJSONObject(loginuser,
                                                                "url");

                                                String message = results
                                                        .getString("message");
                                                String isvalid = results
                                                        .getString("isvalid");
                                                if (isvalid.contains("FALSE")) {
                                                } else {
                                                    //pd.dismiss();
                                                    Toast.makeText(
                                                            ChangePassword.this,
                                                            "Password changed successfully",
                                                            Toast.LENGTH_SHORT).show();
                                                }
                                            } catch (Exception e) {
                                                 //TODO: handle exception
                                                e.printStackTrace();
                                            }
                                        }
                                    }
                             }catch(Exception e)
                             {
                                 e.printStackTrace();
                             }
                             }
                            }), 1000);


                        }
                    }

                });
  • 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-26T17:09:09+00:00Added an answer on May 26, 2026 at 5:09 pm

    You are not dismissing the same ProgressDialog that you are showing. Replace this:

    final ProgressDialog pd = new ProgressDialog(ChangePassword.this);
    ProgressDialog.show(ChangePassword.this, "", "Loading...", false, true);
    

    with this:

    final ProgressDialog pd = ProgressDialog.show(ChangePassword.this, "", "Loading...", false, true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to convert a value from nanoseconds to seconds? Here's the code segment: import
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just
See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
I am trying to get all css link from html like this segment of
I'm not sure if this is the right place to ask, but here goes...
I am trying to implement a linked list using following code, I got segment
Overlooking something basic here but I am trying to set a variable and have
I was trying to work with the codeigniter pagination class. Here is my code
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),

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.