title: Access textview on another layout
body: <p>I have made a popup, which works fine, but I'd like to write to the TextView on it. Using the standard method doesn't work (just crashes it), despite Eclipse finding the TextView's id and not showing any problems. The popup is in another XML layout.</p>
  
  <p>Generates the popup</p>
  
  <pre><code>    public PopupWindow pw;
  
  public void popUpShow() {
      LayoutInflater inflater = (LayoutInflater)
             this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      pw = new PopupWindow(
             inflater.inflate(R.layout.popup, null, false), 
             400, 
             600, 
             true);
              pw.showAtLocation(this.findViewById(R.id.main), Gravity.CENTER, 0, 0);
  }
  </code></pre>
  
  <p>Layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/popup_layout"
  android:orientation="vertical"
  android:padding="10dp"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:background="#AAA"
  &gt;
  
  &lt;TextView
      android:id="@+id/popupOut"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="10dp"
      android:text=""
  /&gt;
  
  &lt;Button
      android:id="@+id/popupclose"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/close"
      android:onClick="popUpHide" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>