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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:48:49+00:00 2026-05-22T00:48:49+00:00

It is definitely working as postData sends to my site and forwards an email

  • 0

It is definitely working as postData sends to my site and forwards an email which it is doing. But loadingDialog does not execute ( it may be but it is a very quick process). The last process sentdialog is not executing as it brings up a new dialog saying sent and is not happening.
I have this script for the async

    protected class sendReport extends AsyncTask<Void, Void, Void> {
    protected void onProgressUpdate()  {
         progressdialog();
    }
    protected void onPostExecute() {
        sentdialog();
        loadingDialog.dismiss();
    }
    @Override
    protected Void doInBackground(Void... arg0) {
        postData();
        publishProgress();
        return null;
    }

}

Below is the sent dialog script.

public void sentdialog(){
    //set up dialog
    final Dialog sentdialog = new Dialog(context);
    sentdialog.setContentView(R.layout.sentdialog);
    sentdialog.setTitle("Sent");
    sentdialog.setCancelable(true);

    final Button button = (Button) sentdialog.findViewById(R.id.Button01);
    button.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            sentdialog.dismiss();
        }
    });   
    sentdialog.show();
} 
  • 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-22T00:48:50+00:00Added an answer on May 22, 2026 at 12:48 am

    EDIT: You could just do this with a handler given activity Main:

    first create ONE handler per activity:

    private ProgressDialog progress;
    private Handler myHandler= new Handler(){
        @Override
        public void  handleMessage(Message msg){         
            switch(msg.what){
                case 0:
                    progress.dismiss();
                    sentDialog();
                    break;
                default:
                    super.handleMessage(msg);
                    break;
            }
        }
    };
    

    I wrote your progressDialog, postData, sentDialog methods:

    private ProgressDialog progressDialog() {
        progress= new ProgressDialog(this);
        progress.setIndeterminate(true);
        progress.setMessage("I am thinking");
        return progress;
    }
    private String postData() {
        try{
        Thread.sleep(1000);
        }
        catch(Exception e){;}
        Log.d(TAG,"postData");
        return "done";
    }
    private void sentDialog() {
        Toast.makeText(Main.this,"Sent", Toast.LENGTH_SHORT).show();
    }
    

    And called in onclick:

    // DISPLAY ON CLICK HANDLER
    displayButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                progressDialog().show();
            Thread thread= new Thread( new Runnable() {
                public void run() {
                    postData();
                    myHandler.sendEmptyMessage(0);
                }
            });
            thread.setDaemon(true);
            thread.start();
            }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following is not working and I am definitely missing the obvious but would
This seems really easy, but it's definitely not working as expected. In WPF 4.0,
The first one is definitely something that works, but which one below is the
Perhaps not directly programming related, but definitely product / commercially related. And I can't
I'm using Django/Python, but pseudo-code is definitely acceptable here. Working with some models that
This is part of a script I was working on which definitely returns and
I am definitely not seeing the issue as to why this isn't working. Any
I'm working with an application which connects to a database. I definitely want to
I've searched a bit before asking this but I definitely can't get it working...
I am working on a login section for a new project, which definitely requires

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.