【问题标题】:How to dismiss material dialog(afollestad) from the adapter it is calling?如何从它正在调用的适配器中关闭材质对话框(afollestad)?
【发布时间】:2017-08-29 04:32:29
【问题描述】:

如何在 DialogAdapter(mContext,nListId,(ArrayList<String>)imagelist) 中调用 materialDialog.dismiss() ,以便通过适配器关闭对话框? 我尝试将materialDialog 作为参数传递给Dialogadapter,但在OnBindViewHolder() 中调用materialDialog.dismiss() 会给出空指针异常。 这是材料对话框库的链接:https://github.com/afollestad/material-dialogs

materialDialog = new MaterialDialog.Builder(mContext)
                                    .title("Choose Node")
                                    .adapter(new DialogAdapter(mContext,nListId,(ArrayList<String>)imagelist,materialDialog), null)
                                    .positiveText("YES")
                                    .negativeText("CANCEL")
                                    .build();
                                    .show();

【问题讨论】:

    标签: android dialog android-alertdialog


    【解决方案1】:

    您可以为此目的使用监听器

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-02
      • 1970-01-01
      • 1970-01-01
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-13
      相关资源
      最近更新 更多