【发布时间】: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