title: Click event using DataBinding Library inside Recyclerview's adapter
body: <p>I am new to  DataBinding Library and using it in an adapter of recyclerview.I want to open another activity on click of an view and pass an id to it.</p>
  
  <p>Below is my xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;data&gt;
          &lt;variable
              name="trainingPlanResponse"
              type="xyz.TrainingPlanResponse" /&gt;
          &lt;variable
              name="presenter"
              type="xyz.MyPlansAdapter"/&gt;
      &lt;/data&gt;
  &lt;TextView
      android:id="@+id/tvPlan"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:drawableLeft="@drawable/ic_launcher"
      android:drawableRight="@drawable/arrow_right"
      android:layout_margin="@dimen/dp15"
  
      android:text="@{trainingPlanResponse.planName}"
      android:onClick="@{presenter.onClick}"
      android:drawablePadding="@dimen/dp5"
      android:textSize="@dimen/sp18"
      android:textColor="@color/black_variant5"
      android:gravity="center_vertical"
      /&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Below is adapter code-</p>
  
  <pre><code>class MyPlansAdapter(private val context: Context?, private val list:ArrayList&lt;TrainingPlanResponse&gt; ):RecyclerView.Adapter&lt;MyPlansAdapter.ViewHolder&gt;()
  {
  
      override fun onBindViewHolder(holder: ViewHolder?, position: Int) {
          holder!!.binding!!.setVariable(BR.trainingPlanResponse,list.get(position));
          holder!!.binding!!.setVariable(BR.presenter,this);
  //        holder!!.tvPlans.text=list.get(position).planName
      }
  
      override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
          val itemView=LayoutInflater.from(context).inflate(R.layout.item_myplans,parent,false);
          return ViewHolder(itemView);
      }
  
      override fun getItemCount(): Int {
          return list.size
      }
  
     fun onClick()
      {
          val intent = Intent(context, PlanWeekActivity::class.java)
          context!!.startActivity(intent)
      }
  
      inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
      {
  //        val tvPlans: TextView
            var  binding: ViewDataBinding?
  
  
          init {
              binding = DataBindingUtil.bind(itemView);
  
          }
  
      }
  }
  </code></pre>
  
  <p>I tried using onClick from xml and getting below error-</p>
  
  <blockquote>
    <p>[kapt] An exception occurred:
    android.databinding.tool.util.LoggedErrorException: Found data binding
    errors.
    ****/ data binding error ****msg:Listener class android.view.View.OnClickListener with method onClick did not match
    signature of any method presenter.onClick
    file:xyz/item_myplans.xml
    loc:20:23 - 20:39 ****\ data binding error ****</p>
  </blockquote>
  
  <p>Also I am not able to understand how will i pass planId to it?
  My Model is-</p>
  
  <pre><code>class TrainingPlanResponse{
      var planId:String?=null;
  var planName:String?=null;
  }
  </code></pre>