设置超时对话框中的android? [英] set timeout Dialog in android?
本文介绍了设置超时对话框中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想设置超时对话框(进度对话框)在Android中,做出了一段时间后,对话框消失(如果有一些动作没有反应!)
I want to set timeout for Dialog (progress dialog) in android , to make the dialog disappears after a period of time (if there is No response for some action !)
推荐答案
同样的方法中的这个帖子验证工作(长而不是浮动):
The same approach as in this post is verified to work (with long instead of float):
public void timerDelayRemoveDialog(long time, final Dialog d){
new Handler().postDelayed(new Runnable() {
public void run() {
d.dismiss();
}
}, time);
}
这篇关于设置超时对话框中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文