how can really show ProgressDialog while waiting for end process

孤者浪人 提交于 2019-12-02 00:12:17

问题


I want to show ProgressDialog but ProgressDialog never really rendered ! And I want to end this process to start next state. this is my code:

ProgressDialog waitProgressDialog = new ProgressDialog(getContext());
            waitProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
            waitProgressDialog.setMessage("please wait..");
            waitProgressDialog.setOnShowListener(new OnShowListener() {

                @Override
                public void onShow(DialogInterface dialog) {
                    ExirDebugger.println("----------TEST999999 START");
///same sqlit datasouce select
                    ExirDebugger.println("----------TEST999999 END");
                }
            });
            waitProgressDialog.show();

android not render anything while all work end! can anyone help me?


回答1:


I use

ProgressDialog dialog = ProgressDialog.show(className.this, "", "Loading. Please wait...", true);

 //Do stuff

dialog.dismiss();


来源:https://stackoverflow.com/questions/17851343/how-can-really-show-progressdialog-while-waiting-for-end-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!