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

The Archive Base Latest Questions

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

I am saving the imae from drawing canvas. It takes some seconds to geting

  • 0

I am saving the imae from drawing canvas.
It takes some seconds to geting save to the sdcard.
So, During the process of save i want to show the dialog that the Image getting save…

So how to implement the progress dialog for that ?

The code for Image save is as like below:

 case R.id.saveBtn:
            Toast.makeText(getApplicationContext(), "Save", Toast.LENGTH_SHORT).show();
            final Activity currentActivity  = this;
            Handler saveHandler = new Handler(){
                @Override
                public void handleMessage(Message msg) {
                    final AlertDialog alertDialog = new AlertDialog.Builder(currentActivity).create();
                    alertDialog.setTitle("Drawing App");
                    alertDialog.setMessage("Your drawing had been saved :)");
                    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            return;
                        }
                    });
                    alertDialog.show();
                }
            } ;

           new ExportBitmapToFile(this,saveHandler, drawingSurface.getBitmap()).execute();

        break;
  • 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-26T18:20:46+00:00Added an answer on May 26, 2026 at 6:20 pm

    Since you are using AsyncTask (ExportBitmapToFile) you can call ProgressDialog in preExecute() and dismiss it in postExecute method. There are no Handlers required to do this.

    edit

    class ExportBitmapToFile extends AsyncTask<...> {
        private ProgressDialog  m_progressDialog = null;
        .... 
    
        @Override
        protected void onPreExecute(){
            m_progressDialog = new ProgressDialog(m_context);
            m_progressDialog.setMessage("please wait...");
            m_progressDialog.setCancelable(false);
            m_progressDialog.show();
        }
    
        @Override
        protected void onPostExecute(HashMap<String, String> result){
            m_progressDialog.dismiss();
            //your alert dialog with message to user
            AlertDialog.Builder builder = new AlertDialog.Builder(currentActivity);
                builder.setTitle("Drawing App");
                builder.setMessage("Your drawing had been saved :)");
                builder.setButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                        return;
                    }
                });
            alertDialog = builder.create()
            alertDialog.show();
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help saving a PPM file in C/C++. I want to save an
I am saving youtube video id's in my database and want to show that
I am saving some small images to Xml as a Byte[] via the following
I am saving all the words from a file like so: sentence = fileName
After saving some values into the database, I am finding it difficult to print
I'm saving some user data in the internal storage using the openFileOutput method in
I'm saving some data using a series of NSDictionaries, stored in an NSMutableArray and
I need to saving strings in database. Each string has different size from 1
I'm currently saving some Twitter data in MySQL. My host only lets me run
when saving data from my form I get an empty date on create field

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.