2

I have a problem of showing the progressDialog on android. It did shows up to the screen but it took few seconds before it really show the dialog.

This is the code i did to show the dialog

Handler saveHandler = new Handler() {

                @Override
                public void handleMessage(Message msg) {
                    GallerySaveActivity.this.Submit(progress);

                    Button btn_next = (Button) findViewById(R.id.btn_next);
                    btn_next.setEnabled(true); 
                }
            };
            progress.showDialog(saveHandler, "", "Accessing Facebook ...");
            Thread progress_thread = new Thread(progress); 
            progress_thread.start();

Do I have to do any extra work on the Thread object in order to show the dialog instantly without any delay.

4

1 に答える 1

1

AsyncTask:でダイアログを表示しonPreExecute()、でバックグラウンドタスクを実行することを検討してくださいdoInBackground()

于 2012-07-28T11:09:38.773 に答える