安卓:AlertDialog - 用户点击别的地方 [英] Android: AlertDialog - User click somewhere else

查看:258
本文介绍了安卓:AlertDialog - 用户点击别的地方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个警报-对话框,2个按钮(是/否)
如果用户点击没有的警告对话框中表现正常,进入上点击的方法,但是如果用户点击或地方碰警告对话框,它只是消失的外面,什么都不会发生,有没有什么办法prevent对话框的消失,当用户点击其他地方???

I have an Alert-dialog with 2 buttons( Yes/No ) If user click yes or no the alert dialog behave normal and get into on-click method, but if user click or touch somewhere outside of alert dialog it just disappear, and nothing will happen, Is there any way to prevent dialog from disappearing when user clicked somewhere else???

推荐答案

prevent解雇之外触摸对话框中使用

Prevent dismiss dialog box on outside touch use this

 dialog.setCanceledOnTouchOutside(false);

这篇关于安卓:AlertDialog - 用户点击别的地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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