title: Android Event Listener Data Binding for ViewPager
body: <p>Is it possible to bind a handler for setOnPageChangeListener to a ViewPager in XML file with the Android Binding functionality? </p>
  
  <p>The demos show onClick events but I am curious as to how much event functionality I can implement with it. Any links on the capabilities of Data Binding would be great as well. Thanks.</p>
  
  <p>Hypothetical example:</p>
  
  <p><strong>example_activity.xml</strong></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="handlers" type="com.example.Handlers"/&gt;
  &lt;/data&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/pager"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
  
      android:onPageChangeListener="@{handlers.pageChanged}" /&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><strong>Handler.java</strong></p>
  
  <pre><code>package com.example.viewmodels;
  
  import android.view.View;
  
  public class Handlers {
      public void pageChanged(View view){}
  }
  </code></pre>
  
  <p>The compilation error is:</p>
  
  <p>Error:(62) No resource identifier found for attribute 'onPageChangeListener' in package 'android'</p>