title: How to get Position & View information through onclick Binding Adapter implemented with ViewModel?
body: <p>I want to use Data Binding Library &amp; ViewModel </p>
  
  <ol>
  <li>to identify position of clicked item in List.</li>
  <li>To know on which view the click happened so that I can trigger different Intent.</li>
  </ol>
  
  <p>Here is my XML file (Currently onclick is on RelativeLayout)</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="orgmembvm" 
     type="com.support.android.designlibdemo.include.OrgMemb" /&gt;
      &lt;variable name="orgmembhandlers" 
    type="com.support.android.designlibdemo.View.MyOrgMembHandlers"/&gt;
   &lt;/data&gt;
    &lt;android.support.v7.widget.CardView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginEnd="8dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"&gt;
   &lt;RelativeLayout
      android:id="@+id/org_memb_rec"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:onClick="@{orgmembhandlers::onClickOpenEditRec}"
      android:padding="8dp"&gt;
     //Inner Child element
    &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>BindViewHolder of Adaptor</p>
  
  <pre><code>@Override
  public void onBindViewHolder(@NonNull OrgMembViewHolder holder, int 
  position) {
      holder.mBinding.setOrgmembvm(orgMembArrayList.get(position));
      holder.mBinding.setOrgmembhandlers(new MyOrgMembHandlers());
      holder.mBinding.executePendingBindings();
   }
  </code></pre>
  
  <p>Code in Activity Class for getting viewModel attached to Activity.</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
  ......
  ......
  userModel = ViewModelProviders.of(this).get(OrgMembViewModel.class);
  userModel.getAllLive().observe(this, orgMembList -&gt; {
  mAdapter.updateorgmemblist(orgMembList);
      });
    }
  </code></pre>
  
  <p>How can this be achieved?</p>