title: RecyclerView onClick problems
body: <p>I have been working on <code>RecyclerView</code> and when a user clicks on an item I want the recyclerview panel to be changed. For simple testing purposes I am making the text of the recyclerview item red when clicked upon. The clicking properly but when I scroll the <code>RecyclerView</code>, other items randomly turn red. These random items are not clicked upon and are becoming red by themselves when I scroll. I think my problem should be in the <code>onClick</code> method. </p>
  
  <pre><code>public class interestAdapter extends RecyclerView.Adapter&lt;interestAdapter.MyViewHolder&gt; {
  private LayoutInflater inflater;
  private Context context;
  public ArrayList&lt;String&gt; data = new ArrayList();
  public static MyViewHolder.ViewHolderClick click;
  //public static MyViewHolder.ViewHolderClick click;
  
  
  
  public interestAdapter(Context context, ArrayList&lt;String&gt; objects) {
      this.context = context;
      inflater = LayoutInflater.from(context);
      for(int i = 0; i &lt; objects.size(); i++) {
          data.add(objects.get(i));
      }
  }
  
  public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = inflater.inflate(R.layout.interestpanel, parent, false);
      MyViewHolder holder = new MyViewHolder(view);
      return holder;
  
  }
  
  public int getItemCount() {
      return data.size();
  }
  
  public void setClickListener(MyViewHolder.ViewHolderClick clicker) {
      this.click = clicker;
  }
  
  public void onBindViewHolder(MyViewHolder holder, int position) {
      String current = data.get(position);
      holder.category.setText(current);
  
  
  }
  
  static class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { //implements View.onClickListener {
      TextView category;
      public MyViewHolder(View itemView) {
          super(itemView);
          //itemView.setOnClickListener(this);
  
          category = (TextView) itemView.findViewById(R.id.category);
          category.setOnClickListener(this);
  
  
      }
  
      @Override
      public void onClick(View v) {
  
              MyViewHolder holder = new MyViewHolder(v);
              holder.category.setTextColor(Color.RED);
  
      }
      public TextView getCate() {
          return category;
      }
  
      public static interface ViewHolderClick {
          public void clicked(View view, int position);
      }
  
  
  }
  </code></pre>
  
  <p>}
  `</p>