title: Increment value in specific textview with button click in recyclerview
body: <p>I am working on an app that displays images using recycler view and volley.I have imageview, textview and buttons in each card. I am trying to add functionality to my button that when clicked, will count the number of clicks and display it in a textview. When i click the button, all the textviews in all d rows are updated with the same number of clicks no matter which button was clicked on any row. I want only d row in which d button was clicked's textview to be updated.What am i doing wrong? This is the code</p>
  
  <pre><code>import android.content.Context;
  import android.media.Image;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.ImageButton;
  import android.widget.ProgressBar;
  import android.widget.TextView;
  
  import com.android.volley.toolbox.ImageLoader;
  import com.android.volley.toolbox.NetworkImageView;
  
  import org.w3c.dom.Text;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by Belal on 11/9/2015.
   */
  
  public class CardAdapter extends RecyclerView.Adapter&lt;CardAdapter.ViewHolder&gt; {
      int count = 0;
  
      //Imageloader to load image
      private ImageLoader imageLoader;
      private Context context;
  
      //List to store all superheroes
      List&lt;SuperHero&gt; superHeroes;
  
      //Constructor of this class
      public CardAdapter(List&lt;SuperHero&gt; superHeroes, Context context){
          super();
          //Getting all superheroes
          this.superHeroes = superHeroes;
          this.context = context;
      }
  
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.superheroes_list, parent, false);
          ViewHolder viewHolder = new ViewHolder(v);
          return viewHolder;
      }
  
  
  
      @Override
      public void onBindViewHolder(final ViewHolder holder, int position) {
  
  
  
          //Getting the particular item from the list
          SuperHero superHero =  superHeroes.get(position);
  
          //Loading image from url
          imageLoader = CustomVolleyRequest.getInstance(context).getImageLoader();
          imageLoader.get(superHero.getImageUrl(), ImageLoader.getImageListener(holder.imageView, R.drawable.image, android.R.drawable.ic_dialog_alert));
  
          //Showing data on the views
          holder.imageView.setImageUrl(superHero.getImageUrl(), imageLoader);
          holder.textViewName.setText(superHero.getName());
          holder.textViewPublisher.setText(superHero.getPublisher());
          holder.textViewLikes.setText(superHero.getLikes());
  
          holder.custom_button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  count ++;
                  holder.txtCount.setText(String.valueOf(count));
  
                  }
  
              });
      }
  
  
  
      @Override
      public int getItemCount() {
          return superHeroes.size();
      }
  
  
      class ViewHolder extends RecyclerView.ViewHolder{
          //Views
          public NetworkImageView imageView;
          public TextView textViewName;
          public TextView textViewPublisher;
          public TextView textViewLikes;
          public TextView txtCount;
          public ImageButton custom_button;
          //Initializing Views
          public ViewHolder(View itemView) {
              super(itemView);
              imageView = (NetworkImageView) itemView.findViewById(R.id.imageViewHero);
              textViewName = (TextView) itemView.findViewById(R.id.textViewName);
              textViewPublisher = (TextView) itemView.findViewById(R.id.textViewPublisher);
              textViewLikes = (TextView) itemView.findViewById(R.id.textViewlikes);
              txtCount = (TextView)itemView.findViewById(R.id.txtCount);
              custom_button = (ImageButton) itemView.findViewById(R.id.custom_button);
          }
  
  
      }
  
  }
  </code></pre>