title: Why Isn't My Bound Data Showing Up in Android XML?
body: <p>I have a custom layout that I want to reuse in several places, so I want to be able to pass a title to it, since that's the only value that will actually change. I know I can do that by binding data, but I can't get the data to render.</p>
  
  <p>In my <code>activity.main</code> I have:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:tools="http://schemas.android.com/tools"
                  xmlns:app="http://schemas.android.com/apk/res-auto" &gt;
  
      &lt;RelativeLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  tools:context="com.r.e.MainActivity"&gt;
  
          &lt;include
              layout="@layout/switch_preference_custom_title"
              app:passedTitle="@{@string/hello_world}" /&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/layout&gt;
  </code></pre>
  
  <p>I have defined my custom layout as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" &gt;
  
      &lt;data&gt;
        &lt;variable
          name="passedTitle"
          type="String"/&gt;
      &lt;/data&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
           &lt;TextView
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:text="@{passedTitle}" /&gt;
  
      &lt;/RelativeLayout&gt;
  
   &lt;/layout&gt;
  </code></pre>
  
  <p>I also added</p>
  
  <pre><code>dataBinding {
      enabled = true
  }
  </code></pre>
  
  <p>in my build.gradle. My project compiles and runs fine, and the layout does render (I can tell by giving it a background), but the text is an empty string.</p>