title: How to change particular image in recycler view after clicking
body: <p>I want to change respective image of clicked item in recycler view. Now whats happening is if i click on item 2 image is changing at random item position in the list</p>
  
  <pre><code>public class MyRecyclerViewAdapter extends RecyclerView.Adapter&lt;MyRecyclerViewAdapter.DataObjectHolder&gt; {
  
  private static String LOG_TAG = "MyRecyclerViewAdapter";
  private ArrayList&lt;CRMbean&gt; mDataset;
  private static MyClickListener myClickListener;
  static Context mContext;
  private List&lt;String&gt; mtList ;
  
  
  public MyRecyclerViewAdapter(List&lt;String&gt; filteredList, CRMactivity crMactivity) {
      mtList = filteredList;
  
  }
  
  public static class DataObjectHolder extends RecyclerView.ViewHolder
          implements View
          .OnClickListener {
      public static ImageView testImage;
      TextView name;
      TextView regId;
      TextView roomNo;
  
      public DataObjectHolder(View itemView) {
          super(itemView);
          name = (TextView) itemView.findViewById(R.id.name);
          regId = (TextView)itemView.findViewById(R.id.reg_id);
          roomNo = (TextView)itemView.findViewById(R.id.roomno);
           testImage = (ImageView)itemView.findViewById(R.id.logo);
  
  
          Log.i(LOG_TAG, "Adding Listener");
          itemView.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          myClickListener.onItemClick(getAdapterPosition(), v);
  
      }
  }
  public void setOnItemClickListener(MyClickListener myClickListener) {
      MyRecyclerViewAdapter.myClickListener = myClickListener;
  }
  public MyRecyclerViewAdapter(ArrayList&lt;CRMbean&gt; myDataset) {
      mDataset = myDataset;
  }
  
  
  
  
  
  @Override
  public MyRecyclerViewAdapter.DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
      View view = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.card_view_row, parent, false);
  
      DataObjectHolder dataObjectHolder = new DataObjectHolder(view);
      return dataObjectHolder;
  }
  
  @Override
  public void onBindViewHolder(MyRecyclerViewAdapter.DataObjectHolder holder, int position) {
      holder.name.setText(mDataset.get(position).getName());
      holder.regId.setText(mDataset.get(position).getRegId());
      holder.roomNo.setText(mDataset.get(position).getRoomNo());
  
  }
  
  public void addItem(CRMbean dataObj, int index) {
      mDataset.add(index, dataObj);
      notifyItemInserted(index);
  }
  
  public void deleteItem(int index) {
      mDataset.remove(index);
      notifyItemRemoved(index);
  }
  
  @Override
  public int getItemCount() {
      return mDataset.size();
  }
  
  
  public interface MyClickListener {
      void onItemClick(int position, View v);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>the above is for adpater of recyclerview</p>
  
  <pre><code> ((MyRecyclerViewAdapter) mAdapter).setOnItemClickListener
              (new MyRecyclerViewAdapter.MyClickListener() {
                  @Override
                  public void onItemClick(int position, View v) {
                      Log.i(LOG_TAG, " Clicked on Item " + position);
  
                      MyRecyclerViewAdapter.DataObjectHolder.testImage.setImageResource(R.drawable.video_icon_fill);
                      //getInformation(position);
  
                  }
              });
  </code></pre>
  
  <p>the above code is for OnclickListener</p>