title: Single selection in RecyclerView
body: <p>I know there are no default selection methods in the <code>RecyclerView</code> class, but I have tried in the following way:</p>
  <pre><code>public void onBindViewHolder(ViewHolder holder, final int position) {
      holder.mTextView.setText(fonts.get(position).getName());
      holder.checkBox.setChecked(fonts.get(position).isSelected());
  
      holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              if(isChecked) {
                  for (int i = 0; i &lt; fonts.size(); i++) {
                      fonts.get(i).setSelected(false);
                  }
                  fonts.get(position).setSelected(isChecked);
              }
          }
      });
  }
  </code></pre>
  <p>While trying this code, I got the expected output, but not completely.</p>
  <p>I will explain this with images.</p>
  <p>By default, the first item is selected from my adapter.</p>
  <p><img src="https://i.stack.imgur.com/M6HlK.png" alt="" /></p>
  <p>Then I select the 2nd, then the 3rd, then the 4th and finally the 5th one.</p>
  <p><img src="https://i.stack.imgur.com/SyeRP.png" alt="" /></p>
  <p>Here only the 5th should be selected, but all five are getting selected.</p>
  <p>If I scroll the list to the bottom and come again to the top, I get what I expect.</p>
  <p><img src="https://i.stack.imgur.com/CW5sX.png" alt="" /></p>
  <p>How can I overcome this issue? And sometimes if I scroll the list very fast, some other item gets selected. How can I overcome this problem too?</p>
  <p>While I was trying to use <code>notifyDataSetChanged()</code> after <code>fonts.get(position).setSelected(isChecked);</code>, I got the following exception:</p>
  <pre><code>java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
          at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:1462)
          at android.support.v7.widget.RecyclerView$RecyclerViewDataObserver.onChanged(RecyclerView.java:2982)
          at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:7493)
          at android.support.v7.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:4338)
          at com.app.myapp.screens.RecycleAdapter.onRowSelect(RecycleAdapter.java:111)
  </code></pre>