title: How to dismiss material dialog(afollestad) from the adapter it is calling?
body: <p>how to call <code>materialDialog.dismiss()</code> inside the <code>DialogAdapter(mContext,nListId,(ArrayList&lt;String&gt;)imagelist)</code> , so that dialog is dismissed through the Adapter?
  i have tried passing <code>materialDialog</code> as a parameter to the <code>Dialogadapter</code> , but calling <code>materialDialog.dismiss()</code> in <code>OnBindViewHolder()</code> gives null pointer Exception.
  This is the link to the Material Dialog library : <a href="https://github.com/afollestad/material-dialogs" rel="nofollow noreferrer">https://github.com/afollestad/material-dialogs</a></p>
  
  <pre><code>materialDialog = new MaterialDialog.Builder(mContext)
                                      .title("Choose Node")
                                      .adapter(new DialogAdapter(mContext,nListId,(ArrayList&lt;String&gt;)imagelist,materialDialog), null)
                                      .positiveText("YES")
                                      .negativeText("CANCEL")
                                      .build();
                                      .show();
  </code></pre>