title: set text to textview in other layout android
body: <p>It's a very rare thing that I need to do, but I wanted to see if it was possible.</p>
  
  <p>I am listing in a <code>ListView</code> items with the help of a custom adapter. So far so good, but what I need now edit the text in another layout which contains my <code>ListView</code>.</p>
  
  <p><strong>Layout</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#F2F2F2"
  android:gravity="top"
  android:orientation="vertical" &gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="Disponibles"
      android:layout_marginTop="15dp"
      android:gravity="center"
      android:textColor="#000000"
      android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  &lt;TextView
      android:id="@+id/txtDisponibles"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/textView1"
      android:textSize="40dp"
      android:gravity="center"
      android:text="" /&gt;
  
  &lt;TextView
      android:id="@+id/textView3"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_marginTop="28dp"
      android:background="@drawable/titulo_lista"
      android:text="Inscripciones"
      android:paddingBottom="5dp"
      android:paddingTop="5dp"
      android:paddingLeft="10dp"
      android:paddingRight="10dp"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:textColor="#FFFFFF" /&gt;
  
  &lt;ListView
      android:id="@+id/listView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/EditText01"
      android:cacheColorHint="#00000000" 
      android:textColor="#000000"
      android:textSize="15sp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Format listview</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;TextView
      android:id="@+id/txtNombre"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_marginTop="10dp"
      android:paddingLeft="10dp"
      android:text="TextView" /&gt;
  
  &lt;TextView
      android:id="@+id/txtTicket"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/txtNombre"
      android:paddingLeft="10dp"
      android:text="TextView" /&gt;
  
  &lt;TextView
      android:id="@+id/txtOrden"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/txtTicket"
      android:paddingLeft="10dp"
      android:text="" /&gt;
  
  &lt;TextView
      android:id="@+id/txtAsiento"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/txtOrden"
      android:paddingLeft="10dp"
      android:visibility="gone"
      android:text="" /&gt;
  
   &lt;TextView
      android:id="@+id/txtNumero"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/txtAsiento"
      android:paddingLeft="10dp"
      android:visibility="gone"
      android:text="" /&gt;
  
  &lt;Button
      android:id="@+id/button1"
      style="?android:attr/buttonStyleSmall"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/txtOrden"
      android:layout_alignParentRight="true"
      android:layout_marginRight="23dp"
      android:background="@drawable/btn_green_small"
      android:maxHeight="48dp"
      android:maxWidth="80dp"
      android:shadowColor="#A8A8A8"
      android:text="Validar"
      android:textColor="#FFFFFF" /&gt;
  
  &lt;TextView
      android:id="@+id/txtMensaje"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/button1"
      android:text="SDSDSDS"
      android:layout_marginRight="18dp"
      android:visibility="gone"
      android:textSize="10dp" /&gt;
  
   &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Each item in my <code>ListView</code> has a <code>Button</code> when you click on that <code>Button</code> need to change the value of <code>txtDisponible</code> the layout container.</p>
  
  <pre><code>holder.btn.setOnClickListener(new View.OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                       TextView t=(TextView)layout.findViewById(R.id.txtDisponible);
                       t.setText("E-ticket validado");
                  }
  }
  </code></pre>
  
  <p>The error I get is that the object is <code>null</code>.</p>