title: Android - <Include/> Data Binding
body: <p>I've reading some examples and Android documentation, but my implementation isn't working</p>
  
  <p>I've my activity and my viewmodel.</p>
  
  <p><b>Activity Layout</b></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout&gt;
  
      &lt;data&gt;
          &lt;variable
              name="viewmodel"
              type="package.to.viewmodel"/&gt;
      &lt;/data&gt;
  
      &lt;android.support.v4.widget.DrawerLayout&gt;
  
          &lt;include
              app:viewmodel="@{viewmodel}"/&gt;
  
          &lt;!-- More Code --&gt;
  
      &lt;/android.support.v4.widget.DrawerLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><b>Include Layout</b></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout&gt;
  
      &lt;data&gt;
  
          &lt;variable
              name="viewmodel"
              type="package.to.viewmodel"/&gt;
      &lt;/data&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout&gt;
  
          &lt;!-- More Code --&gt;
  
          &lt;android.support.design.widget.FloatingActionButton
              android:onClick="@{viewmodel.newButtonClickListener}"/&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><b>ViewModel Code</b></p>
  
  <pre><code>public class MainViewModelImpl implements MainViewModel {
  
      private View.OnClickListener newButtonClickListener;
      private View.OnClickListener newEventButtonClickListener;
      private View.OnClickListener newAssignmentButtonClickListener;
      private View.OnClickListener newContactButtonClickListener;
      private View.OnClickListener newChatButtonClickListener;
  
      //All the getters for the Listeners
  }
  </code></pre>
  
  <p>So the code builds and runs without errors, but when I tap the button nothing happens, even though my listeners are correctly implemented.</p>
  
  <p>Does anyone has an idea on why are the listeners not been triggered?</p>
  
  <p><b>Update</b>
  When I was debugging the application, I realize that the viewmodels in the include layout are null, even after the binding.</p>