title: Android DataBinding & MVVM - Using same name for layout files in different layout folders
body: <p>I've been developing an app with data binding &amp; MVVM.</p>
  
  <p>I'm trying to use an alternative layout for my app on landscape mode. I have: </p>
  
  <pre><code>layout/fragment_content.xml
  layout-land/fragment_content.xml
  </code></pre>
  
  <p>Both layouts have same views with different look, and get feeds from same view models, like this:</p>
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
  &lt;data class="MyBinding"&gt;
  
      &lt;variable
          name="viewModel"
          type="com.myapp.package.viewModel.VMFirst"/&gt;
  
      &lt;variable
          name="controlModel"
          type="com.myapp.package.viewModel.VMSecond"/&gt;
  &lt;/data&gt;
  
  &lt;DIFFERENT CONTENT HERE&gt;
  </code></pre>
  
  <p>All the views and id's exist in both layouts.</p>
  
  <p>Well, problem is, it doesn't compile, error is simply <code>"cannot find symbol method getViewModel"</code> and getter for the other variable.</p>
  
  <p>What I tried so far:</p>
  
  <ol>
  <li><p>Using layout and layout-land folders ( Failed, error is explained above )</p></li>
  <li><p>Using layout aliases <a href="https://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters">Use Layout Aliases</a> which I found here <a href="https://code.google.com/p/android/issues/detail?id=199344">Issue 199344: Data binding does not work with layout aliases</a>. I didn't change anything in xml files while trying this approach. This also failed, error is <code>Could not write to com.myapp.package.databinding.MyBinding</code></p></li>
  </ol>
  
  <p>Is it not possible to use data binding <code>data</code> tag in multiple layout files ? What should I use to use different layouts for different states while using data binding ? Thanks !</p>
  
  <p>Edit: deleting <code>class="MyBinding"</code> did not change errors.</p>