onActivityResult in RecyclerView.Adapter<MyAdapter.MyViewHolder>
<p>I tried to open gallery from my adapter.</p>

<pre><code>emp_photo_edit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                ((EmployeeActivity)context).startActivityForResult(i, 2017);
            }
        });
</code></pre>

<p>Then i want to show that choosen image into my <code>imageview</code> in my <code>recycycleview</code>, how to do that? Because i cant add <code>onActivityResult</code>on my <code>adapter</code>. Thanks in advance</p>

<blockquote>
  <p>Edit</p>
</blockquote>

<p>My Full Code</p>

<pre><code>public static class MyViewHolder extends RecyclerView.ViewHolder {
    ....

    public MyViewHolder(View v) {
        super(v);
        ....

    }
    public void bind(final Employee item, final OnItemClickListener listener, final Context context) {
        ....
        generateDialog(item,dialog_employee);
        ....

    }

    ...
    ...
    void generateDialog(Employee item, View v){
        //Dialog child
        //Photo
        emp_photo_edit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                ((EmployeeActivity)context).startActivityForResult(i, 2017);
            }
        });
        ....
    }
}
</code></pre>