title: How delete a row of recycler view from ViewHolder
body: <p>thanks to stop by.</p>
  
  <p>Not a long time ago someone explain to me that you should'nt store data in <code>ViewHolder</code>, I get why. But then it complicate something.</p>
  
  <p>I want to remove a Row if user click on a <code>button</code> inside the row. So i need to access <code>adapter</code>. But I can't store it on <code>ViewHolder</code>. What the way ?</p>
  
  <p>I'am also looking for the best <code>recyclerview</code> article that you know because it look like people don't know what they talking about in most of the stack overflow and give bad advise (Store data inside <code>ViewHolder</code>)</p>
  
  <p><strong>EDIT :</strong> I'am trying one solution but getTag return me null when I'am in adapter</p>
  
  <p>Here is my item and the binding : </p>
  
  <pre><code>public final class ItemViewMail extends RecyclerView.ViewHolder {
  
      private AppCompatImageButton cancelButton;
  
  
      public ItemViewMail(View itemView) {
          super(itemView);
          this.cancelButton = itemView.findViewById(R.id.profile_item_edit_email_cancel_image_button);
      }
  
      public void bind(Data data, View.OnClickListener deleteOnClickListener) {
          this.itemView.setTag(data);
  
          if (cancelButton != null) {
              cancelButton.setOnClickListener(deleteOnClickListener);
          }
      }
  
  }
  </code></pre>
  
  <p>My adapter : </p>
  
  <pre><code>    private ArrayList&lt;Data&gt; rowDataArrayList;
  
      MyPVPViewAdapter(ArrayList&lt;Data&gt; rowDataArrayList) {
          this.rowDataArrayList = rowDataArrayList;
      }
  
      @NonNull
      @Override
      public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int itemType) {                    
      return new ItemViewMail(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.profile_item_edit_email, viewGroup ,false));
      }
  
      @Override
      public void onBindViewHolder(@NonNull RecyclerView.ViewHolder myViewHolder, int position) {
            ((ItemViewMail) myViewHolder).bind((Data) rowDataArrayList.get(position).getData(), onClickListener);
      }
  
      @Override
      public int getItemViewType(int position) {
          return rowDataArrayList.get(position).getType();
      }
  
      @Override
      public int getItemCount() {
          return rowDataArrayList.size();
      }
  
      View.OnClickListener onClickListener = new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Data data = (Data) v.getTag();
          }
      };
  
  }
  </code></pre>