【问题标题】:AlertDialog setItems without onclick没有 onclick 的 AlertDialog setItems
【发布时间】:2013-06-08 19:39:51
【问题描述】:

我创建了一个 AlertDialog 并从列表中添加了项目:

builder.setItems(items, new DialogInterface.OnClickListener() {

这可行,但问题是我不希望在单击某个项目时关闭对话框。 有没有可能做到这一点?

【问题讨论】:

    标签: android dialog android-alertdialog onclicklistener android-dialog


    【解决方案1】:
     builder.setItems(items, null);
    

    通常会使用 AlertDialog 来解决问题,您应该检查源代码以确认。

    【讨论】:

    • 谢谢你,这比我想象的要容易:D 有时我只是瞎了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-10
    • 2015-07-18
    • 1970-01-01
    • 2019-10-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多