How to call method in fragment from adapter Android
<p>I need help so I have a fragment which has a <code>RecycleView</code> and inside the <code>RecycleView</code> there is a button.</p>

<p>The button after click must open the dialog which already declared in base fragment so I only call like <code>openDialog(DIALOG_CHECK);</code> </p>

<p>Now how can I call that dialog on my adapter I already make a method in fragment and call it from the adapter and make an error "Java lang null pointer" </p>

<p>This is my code : </p>

<pre><code>DeliveryFragment delivFrag = new DeliveryFragment();
holder.editButton.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
         delivFrag.doEdit();
     }
});
</code></pre>

<p>And in fragment </p>

<pre><code>public void doEdit(){
   openDialog(DIALOG_EDIT_ITEM);
}
</code></pre>