进度对话框在android系统没有显示? [英] progress dialog not showing in android?

查看:169
本文介绍了进度对话框在android系统没有显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在没有进度对话框在android系统不显示?我想知道的情况下当上述可能发生的:

when does the progress dialog not show in android? i want to know the circumstances when the above can happen:

在我的案件的进度对话框并没有在这种情况下显示:

in my case the progress dialog was not showing in this case:

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

什么是拇指与对话框中的一般规则?

what is the general rule of thumb with dialog boxes?

感谢您提前。

修改
执行.show()命令时进度对话框应该显示。但是,当otherfucntion()被调用时,确实progressdialog表演停止的previous命令?

EDIT when the .show() command is executed the progress dialog should show. But when the otherfucntion() is called, does the previous command of progressdialog show stop?

推荐答案

好像你需要使用的的AsyncTask 的UI(包括progressDialog)不会,如果UI线程仍在忙于更新。有这么多的例子为。

Seems like you need to use AsyncTask the UI (including the progressDialog) will not update if the UI thread is still busy. There are many examples in SO for that.

和作为一个经验法则 - 如果您需要进度对话框 - 你需要的AsyncTask

And as a rule of thumb - if you need Progress dialog - you need AsyncTask.

这并不是说任何命令停止,它只是,如果你执行的UI线程上的方法顺序,用户界面​​可能不会被更新,直到序列结束,这是继 progressDialog .dismiss(),所以progressDialog不应继续显示。

It is not that any command stops, it is just that if you execute a sequence of methods on the UI thread, the UI will probably not be updated until the sequence is over, which is after progressDialog.dismiss(), so the progressDialog should not be displayed anymore.

这篇关于进度对话框在android系统没有显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆