title: Check Box listener on RecyclerView with DataBinding
body: <p>im trying to populate a list of note/message with check box in the item view.</p>
  
  <p>Ive tried set listener unto the checkbox. sadly upon check box click nothing happens.</p>
  
  <p>if i set listener unto the parent view. its able to trigger onClick method. but this will be triggered each time user click the whole  item in the list.</p>
  
  <p>my objectives is more on setting listener for checkbox. </p>
  
  <p>so ill know that user has selected note(s) from the list.</p>
  
  <p>heres my code adapter class together with view holder inner class</p>
  
  <pre><code>public class BroadcastRVA extends RecyclerView.Adapter&lt;BroadcastRVA.BroadcastVH&gt;{
  
  private Context mContext;
  private ObservableArrayList&lt;MNote&gt; notes;
  private LayoutInflater inflater;
  
  public BroadcastRVA(Context mContext, ObservableArrayList&lt;MNote&gt; notes, LayoutInflater inflater) {
      this.mContext = mContext;
      this.notes = notes;
      this.inflater = LayoutInflater.from(mContext);
  }
  
  @Override
  public BroadcastRVA.BroadcastVH onCreateViewHolder(ViewGroup parent, int viewType) {
      NoteListitemBinding binding = NoteListitemBinding.inflate(inflater);
      View view = LayoutInflater.from(parent.getContext()).inflate(
              R.layout.note_listitem, null);
      BroadcastVH viewHolder = new BroadcastVH(binding, view);
      // create a new view
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder(BroadcastVH holder, final int position) {
      final  MNote note = notes.get(position);
      holder.cbox.setChecked(note.isSelected());
      holder.cbox.setTag(note);
      holder.vBinding.setNote(note);
      holder.cbox.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              CheckBox cb = (CheckBox) v;
              MNote note = (MNote) cb.getTag();
              note.setIsSelected(cb.isChecked());
              notes.get(position).setIsSelected(cb.isChecked());
              Toast.makeText(
                      v.getContext(),
                      "Clicked on Checkbox: " + cb.getText() + " is "
                              + cb.isChecked(), Toast.LENGTH_LONG).show();
          }
      });
  }
  
  public ObservableArrayList&lt;MNote&gt; getNotes() {
      return notes;
  }
  /**
   * Returns the total number of items in the data set hold by the adapter.
   *
   * @return The total number of items in this adapter.
   */
  @Override
  public int getItemCount() {
      if (notes != null)
          return notes.size();
      else return 0;
  }
  
  public class BroadcastVH extends RecyclerView.ViewHolder {
      NoteListitemBinding vBinding;
      TextView uuid;
      CheckBox cbox;
  
      public BroadcastVH(NoteListitemBinding binding, View view) {
          super(binding.getRoot());
          this.vBinding = binding;
          this.uuid = (TextView) view.findViewById(R.id._UUID);
          this.cbox = (CheckBox) view.findViewById(R.id.deleteNote);
      }
      }
  } 
  </code></pre>
  
  <p>note_list_item.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;data&gt;
          &lt;variable
              name="note"
              type="com.pbasolutions.android.model.MNote" /&gt;
      &lt;/data&gt;
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          android:weightSum="1"&gt;
          &lt;TableLayout android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;TableRow
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  &gt;
                  &lt;CheckBox
                      android:layout_width="30dp"
                      android:layout_height="wrap_content"
                      android:id="@+id/deleteNote"
                      android:clickable="true"/&gt;
                  &lt;TextView
                      android:layout_width="270dp"
                      android:layout_height="wrap_content"
                      android:id="@+id/textViewNote"
                      android:layout_column="1"
                      android:layout_marginLeft="5dp"
                      android:text="@{note.textMsgs}"
                      android:editable="false"
                      android:textSize="22sp"/&gt;
                  &lt;TableLayout android:layout_column="1"&gt;
                      &lt;TableRow&gt;
                          &lt;TextView
                              android:layout_width="80dp"
                              android:layout_height="wrap_content"
                              android:id="@+id/textViewNoteDate"
                              android:layout_column="0"
                              android:text="@{note.date}"
                              android:editable="false"
                              android:textSize="15sp"/&gt;
                      &lt;/TableRow&gt;
                  &lt;/TableLayout&gt;
                  &lt;TextView
                      android:layout_width="270dp"
                      android:layout_height="wrap_content"
                      android:id="@+id/_UUID"
                      android:layout_marginLeft="5dp"
                      android:text="@{note._UUID}"
                      android:visibility="invisible"/&gt;
              &lt;/TableRow&gt;
          &lt;/TableLayout&gt;
          &lt;View style="@style/Line" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>