Android 中的进度对话框
我完全了解如何在我的应用程序中显示进度对话框。我只是想知道我们是否可以为此进度对话框设置“超时”间隔。 [我的意思是有没有相关的 API]
我总是可以为此运行一个线程,但我认为如果已经有一个内置的 API 会更好。
I am fully aware on how to display progress dialogues in my application. I just want to know if there is anyway that we can set a "timeout" interval for this progress dialog. [I mean is there any API for this]
I can always run a thread for this, but thought it would be better if there was an inbuilt API already..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有内置的 api。只需使用 AsyncTask 或线程,您已经提到过。
There is no built-in api. Just use AsyncTask or thread, how you have already mentioned.
您也可以使用处理程序(将延迟消息发送到处理程序,处理程序将关闭对话框)。我不知道有什么方法可以告诉对话框在给定时间后自行关闭。
You can use a Handler as well (post a delayed message to the handler and the handler will close the dialog). I don't know any way to tell the dialog to close itself after a given time.