是否有可能使在一个AlertDialog不自动关闭对话框按钮? [英] Is it possible to make a button on an AlertDialog that doesn't automatically close the dialog?
问题描述
我有一个警告对话框一些复选框一个简单的列表视图。我需要选择添加全选/没有,但你不能调出菜单中的警告对话框了,我想从一个按钮来执行此功能。从我见过的任何类型的按钮(正面,中性和负面的)不顾一切关闭对话框。
那么,这可能吗?如果没有,我有什么办法?我最后的缓解是简单地创建一个新的观点和重建一切。是一个新的视图中的最解决方案?
那么,这可能吗?
块引用>不从
AlertDialog
标准按钮,AFAIK。
如果没有,我有什么办法?
块引用>下面是一些:
- 请不要提供全选/无
- 请不要使用
AlertDialog
,但用一个对话框为主题的活动- 请不要使用
的其他一些子类AlertDialog
,而是用对话框
- 您引用的选项(不要使用
setAdapter()
,而是建立自己的查看
的对话内容)- 请不要在所有使用
对话框
,而是通过startActivityForResult一个
(类似于#2,只是不用担心主题)ListActivity
启动()I have a simple list view with some check boxes in an alert dialog. I need to option to add a select all/none but you can't bring up the menu in an alert dialog, and I want to do this function from a button. From what I've seen any kind of button (positive, neutral, and negative) all close the dialog regardless.
So, is this possible? If no, what alternatives do I have? My last mitigation is to simply create a new view and recreate everything. Is a new view the best solution?
解决方案So, is this possible?
Not from the standard buttons in
AlertDialog
, AFAIK.If no, what alternatives do I have?
Here are some:
- Don't offer select all/none
- Don't use
AlertDialog
, but use a dialog-themed activity- Don't use
AlertDialog
, but use some other subclass ofDialog
- Your cited option (don't use
setAdapter()
, but rather create your ownView
for the dialog contents)- Don't use a
Dialog
at all, but aListActivity
started viastartActivityForResult()
(akin to #2, just without worrying about the theme)
这篇关于是否有可能使在一个AlertDialog不自动关闭对话框按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!