title: onCheckedChanged called automatically
body: <p>I have a switch in a recyclerview and data is displayed in the recyclerview after retrieving data from DB. When the recyclerview is opened I read DB and if a field in DB is "Y" I enable the switch or else I disable the switch.
  Now the problem is along with it the onCheckedchanged listener is also called, I want the onCheckedChanged to be called only when user sets the switch manually.</p>
  
  <p>On opening the recyclerview below is executed:</p>
  
  <pre><code>holder.enabledisable.setChecked(messengerRecord.get_is_valid().equalsIgnoreCase("Y"));
  </code></pre>
  
  <p>ViewHolder class:</p>
  
  <pre><code>public class viewHolder extends RecyclerView.ViewHolder implements CompoundButton.OnCheckedChangeListener{
  public SwitchCompat enabledisable;
   public viewHolder(View v) {
              enabledisable = (SwitchCompat) v.findViewById(R.id.enabledisable);
              enabledisable.setOnCheckedChangeListener(this);
  ...................................
  ...................................
  </code></pre>
  
  <p>OncheckedChanged method which is called when the recyclerView is just opened:</p>
  
  <pre><code>@Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              Log.v("ranjith","called oncheckedchanged");
              MessengerRecord rec;
              rec = dbHelper.getRecord(descview.getText().toString());
              switch (buttonView.getId()) {
                  case R.id.enabledisable:
                      if (isChecked) {
                          rec.set_is_valid("Y");
                          dbHelper.updateRecord(rec);
                       }
  }
  </code></pre>
  
  <p>In Layout file:</p>
  
  <pre><code>&lt;android.support.v7.widget.SwitchCompat
      android:layout_marginRight="16dp"
      android:layout_marginEnd="16dp"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:focusable="false"
      android:id="@+id/enabledisable"
      android:layout_alignRight="@+id/textview_to"
      android:layout_alignEnd="@+id/textview_to"
      android:layout_alignParentRight="true"
      android:layout_alignParentEnd="true"/&gt;
  </code></pre>