设置超时对话框中的android?对话框中、android

由网友(〣靈魂撞撃肉軆)分享简介:我想设置超时对话框(进度对话框)在Android中,做出了一段时间后,对话框消失(如果有一些动作没有反应!)I want to set timeout for Dialog (progress dialog) in android , to make the dialog disappears after a per...

我想设置超时对话框(进度对话框)在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); 
}
阅读全文

相关推荐

最新文章