开发者

problem to show progress bar

开发者 https://www.devze.com 2023-03-03 13:59 出处:网络
i want to show spinning wheel progress but it doesn\'t show anything. final ProgressDialog dialog = ProgressDialog.show(AppListActivity.this,

i want to show spinning wheel progress but it doesn't show anything.

final ProgressDialog dialog = ProgressDialog.show(AppListActivity.this,
            "", "Loding...", true);
    final Handler handler = new Handler(开发者_运维知识库) {
        public void handleMessage(Message msg) {
            dialog.dismiss();
        }
    };
    Thread checkUpdate = new Thread() {
        public void run() {

            // Set our custom array adapter as the ListView's adapter.
            listAdapter = new AppArrayAdapter(AppListActivity.this,
                    appsList);
            mainListView.setAdapter(listAdapter);

            handler.sendEmptyMessage(0);
        }
    };
    checkUpdate.start();

please figure out this one.. thanks..


you haven't written dialog.show().. refer to this code

ProgressDialog UpdateDialog = new ProgressDialog(ClassContext);

        @Override
        protected void onPreExecute() {
            // TODO Auto-generated method stub

            UpdateDialog.setTitle("MyApp");
            UpdateDialog.setMessage("Processing data...");
            UpdateDialog.show();
            super.onPreExecute();
        }
        @Override
        protected Object doInBackground(Object... params) {
        //your code
            }
        @Override
        protected void onPostExecute(Object result) {
            // TODO Auto-generated method stub
                //your code
                UpdateDialog.dismiss();     
            }


 ProgressDialog mPrograss=new ProgressDialog(location.this);
            mPrograss.setTitle("loading....");
            mPrograss.setProgressStyle(ProgressDialog.STYLE_SPINNER);
            mPrograss.setMax(1);
            mPrograss.setProgress(2000);
            mPrograss.setButton("save", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {

                }
            });
            mPrograss.setButton2("cancel", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                }
            });
            mPrograss.show();


i think u can use the code below. private ProgressDialog pd; pd = ProgressDialog.show(context, "Please wait...", "Saving to database...", true,false);
. pd.dismiss();

0

精彩评论

暂无评论...
验证码 换一张
取 消