Progress dialog not showing in android?

When is the progress dialog not showing up in android? I want to know the circumstances when this can happen:

in my case, the progress dialog was not shown in this case:

func{
    progressdialog.show();
    ....
    .....
    anotherfunction();
    listview.setAdapter();
    progressdialog.dismiss();
   }

what is the general rule of thumb with dialog boxes?

thank you in advance.

EDIT when the .show () command is executed, an execution dialog should be displayed. But when otherfucntion () is called, does the previous progressdialog command stop?

+3
source share
3 answers

, AsyncTask, ( progressDialog) , . SO .

- , Progress - AsyncTask.

, , , , , , , progressDialog.dismiss(), progressDialog .

+3

, .

ProgressDialog _progressDialog = ProgressDialog.show(this,"Saving Data","Please wait......");
settintAdater();

 private void settingAdater(){

        Thread _thread = new Thread(){

            public void run() {

                Message _msg = new Message();
                _msg.what = 1; 
                 // Do your task where you want to rerieve data to set in adapet
                YourCalss.this._handle.sendMessage(_msg);
            };
        };
        _thread.start();
    }
 Handler _handle = new Handler(){

        public void handleMessage(Message msg) {

            switch(msg.what){

                case 1:
                    _progressDialog.dismiss();
                     listview.setAdapter();
            }
        }
 }
+1

ProgressDialog

ProgressDialog progressDialog = ProgressDialog.show(PrintMain.this, "", 
                    "Uploading Document. Please wait...", true);

,

progressDialog.dismiss();

ProgressDialog..

You can call to show the ProgressDialog in your onPreExecuteclass method AsyncTask, and when your completion rejects it in the methodonPostExecute

0
source

All Articles