title: Kotlin Android Extensions: How to get a reference to a view in a layout that gets included into another layout?
body: <p>I have a layout that includes another layout:</p>
  
  <p>activity_main.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"/&gt;
  
      &lt;include layout="@layout/included_layout" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>included_layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:id="@+id/includedTextView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Included TextView"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>How can I get a reference to the TextView in the included layout? Is it not supported (yet)?</p>
  
  <p>MainActivity:</p>
  
  <pre><code>import android.app.Activity
  import android.os.Bundle
  import android.support.v7.app.AppCompatActivity
  import kotlinx.android.synthetic.activity_main.*
  
  class MainActivity : AppCompatActivity(){
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          textView.text = "text" // works!
          textViewInclude.text = "textInclude" // does not work: "Unresolved reference: textViewInclude "
      }
  }
  </code></pre>