title: Change style of RecyclerView item onClick
body: <p>I would want to <strong>change</strong> the <strong>color</strong> of an <strong>item</strong> in <strong>RecyclerView</strong> when I click on it. <strong>But I want it to remain coloured even after the click</strong>.. until I click on an another item (that becomes coloured).</p>
  
  <p>In the onBindViewHolder method of the RecyclerViewAdapter I have tried this:</p>
  
  <pre><code>     holder.linearlayout.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              holder.linearlayout.setBackgroundColor(Color.RED);
          }
       }
  </code></pre>
  
  <p>The problem is that <strong>if</strong> I try to <strong>set</strong> the <strong>color</strong> in the onBindViewHolder method, the <strong>item remains coloured</strong> even after I click on an another item, because in the onBindViewHolder method I can see only the actual item.</p>
  
  <blockquote>
    <p>Is there a way to set all items to the original state (no item
    coloured) and set the color only to the last item clicked?</p>
  </blockquote>