title: Keep item value using onBindViewHolder in recycler view
body: <p>I am working in <code>RecyclerView</code> where I am getting a list of Strings. I want to keep the value of particular <code>textView</code> if I am clicking on it, problem is that when I am scrolling down and coming Up again, it is not showing me that clicked value on that <code>TextView</code>. I am displaying "Selected", but when I am scrolling and coming again it is showing me default value from that Strings list.</p>
  
  <p>I am putting my code and my screenshot below.</p>
  
  <p>My <code>onBindViewHolder</code> code:</p>
  
  <pre><code> @Override
  public void onBindViewHolder(final RecyclerView.ViewHolder  holder,final int position) {
  
      final String parseObject = arrayList.get(position);
  
      if (holder instanceof MemberViewHolder) {
  
          if (arrayList.size() &gt; 0) {
  
              ((MemberViewHolder) holder).txtTicket.setText(parseObject);
              ((MemberViewHolder) holder).txtTicket.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      ((MemberViewHolder) holder).txtTicket.setTextColor(R.color.red_theme);
                      ((MemberViewHolder) holder).txtTicket.setText("Selected");
                  }
              });
  
          }
  }
  }
  </code></pre>
  
  <p>These Values I am selecting:</p>
  
  <p><img src="https://i.stack.imgur.com/dIOcg.jpg" alt="image 1"></p>
  
  <p>These random selected values are showing which I am getting on scrolling, but I didn't clicked them.</p>
  
  <p><img src="https://i.stack.imgur.com/iAIZB.jpg" alt="Image 2"></p>