title: TextView method setText() not working in method onClick()
body: <p>there. I am a new Android developer, and my experience is still quite lacking. I'm trying to update the GUI by having a log that updates itself every time a button is clicked. My question is: Why don't the "log#" TextViews update with setText() when the "p#" TextViews will? My code is as follows:</p>
  
  <pre><code>public class ZARP extends Activity
  {
  
      ..
      private void b(P p, E)
      {
  
  
          setContentView(R.layout.b);
  
          TextView p1 = (TextView)findViewById(R.id.textView1);
          TextView p2 = (TextView)findViewById(R.id.textView2);
          TextView p3 = (TextView)findViewById(R.id.textView3);
          TextView p4 = (TextView)findViewById(R.id.textView4);
          TextView p5 = (TextView)findViewById(R.id.textView5);
          TextView p6 = (TextView)findViewById(R.id.textView6);
  
          p1.setText("Hello");//WORKS
          p2.setText("Hello");//WORKS
          p3.setText("Hello");//WORKS
          p4.setText("Hello");//WORKS
          p5.setText("Hello");//WORKS
          p6.setText("Hello");//WORKS
      ..
  
  
          Button f = (Button)findViewById(R.id.button2);
  
  
  
          f.setOnClickListener(new OnClickListener()
          {
              public void onClick(View v)
                  {          
  
                      setContentView(R.layout.b);
                      TextView log1 = (TextView)findViewById(R.id.textView7);
                      TextView log2 = (TextView)findViewById(R.id.textView8);
                      TextView log3 = (TextView)findViewById(R.id.textView9);
                      TextView log4 = (TextView)findViewById(R.id.textView10);
  
  
  
  
                      log4.setText(log3.getText());//DOESN'T WORK
                          log3.setText(log2.getText());//DOESN'T WORK             
                      log2.setText(log1.getText());//DOESN'T WORK
                      log1.setText("Hello");//DOESN'T WORK
  
      }
  ...
  
  }
  </code></pre>
  
  <p>And the XML for the b.XML is as follows:</p>
  
  <pre><code>&lt;TableLayout android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/tableRow1" android:baselineAligned="true"&gt;
          &lt;LinearLayout android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/linearLayout6"&gt;
              &lt;ImageView android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/imageView1" android:src="@drawable/icon"&gt;&lt;/ImageView&gt;
          &lt;/LinearLayout&gt;
          &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1"&gt;
              &lt;ImageView android:layout_width="wrap_content" android:id="@+id/imageView2" android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_gravity="right"&gt;&lt;/ImageView&gt;
          &lt;/LinearLayout&gt;
      &lt;/TableRow&gt;
      &lt;LinearLayout android:id="@+id/linearLayout2" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;TextView android:id="@+id/textView1" android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"&gt;&lt;/TextView&gt;
          &lt;TextView android:id="@+id/textView4" android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="top"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
      &lt;LinearLayout android:id="@+id/linearLayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;TextView android:text="TextView" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"&gt;&lt;/TextView&gt;
          &lt;TextView android:id="@+id/textView5" android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="top"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
      &lt;LinearLayout android:id="@+id/linearLayout4" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;TextView android:text="TextView" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"&gt;&lt;/TextView&gt;
          &lt;TextView android:id="@+id/textView6" android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="top"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
      &lt;Button android:layout_height="wrap_content" android:id="@+id/button2" android:layout_width="wrap_content" android:text="@string/f"&gt;&lt;/Button&gt;
      &lt;Button android:layout_height="wrap_content" android:id="@+id/button1" android:layout_width="wrap_content" android:text="@string/r"&gt;&lt;/Button&gt;
      &lt;LinearLayout android:layout_width="wrap_content" android:id="@+id/linearLayout5" android:layout_height="wrap_content" android:orientation="vertical"&gt;
          &lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView10" android:text="TextView"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView9" android:text="TextView"&gt;&lt;/TextView&gt;
          &lt;TextView android:text="TextView" android:id="@+id/textView8" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
          &lt;TextView android:text="TextView" android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  &lt;/TableLayout&gt;
  </code></pre>