title: TextView isn't updating in Android
body: <p>I'm making a simple "novelty" app that counts how many sneezes are done, it's more of a fun app that builds up experience until I do my huge project during the summer. I have two buttons, one adds a sneeze and the other clears how many sneezes there currently are. It holds the highest number of sneezes that there were previously. The problem is, the TextViews never update, they only initialize to zero. I used a Toast.makeText() to make sure that the buttons are working (they are). Any help is appreciated. Thanks</p>
  
  <p>Java code:</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
     private int record_number = 0;
     private int current_number = 0;
  
     protected void onCreate(Bundle savedInstanceState)
     {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.fragment_main);
  
  
          Button add_one = (Button) findViewById(R.id.addone);
          Button clear_1 = (Button) findViewById(R.id.clear);
  
          add_one.setOnClickListener(new OnClickListener()
          {
              public void onClick(View v)
              {
                  current_number += 1;
                  Toast.makeText(MainActivity.this, "Button Clicked " + current_number, Toast.LENGTH_SHORT).show();
              }
          });
  
          clear_1.setOnClickListener(new OnClickListener() {
              public void onClick(View v)
              {
                   current_number = 0;
                   Toast.makeText(MainActivity.this, "Button Clicked", Toast.LENGTH_SHORT).show();
              }
          });
  
          TextView rec_text = (TextView) findViewById(R.id.record_num);
          TextView cur_text = (TextView) findViewById(R.id.current_num);
  
  
          if (current_number &gt;= record_number)
          {
               record_number = current_number;
          }
  
          rec_text.setText(String.valueOf(record_number));
          cur_text.setText(String.valueOf(current_number));
  
      }
   }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      tools:context="com.michail.sneezecounter.MainActivity"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:text="Sneeze Counter"
          android:id="@+id/title"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:text="Record Number of Sneezes:"
          android:id="@+id/textView"
          android:layout_below="@+id/title"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="72dp" /&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Add one Sneeze"
          android:id="@+id/addone"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="76dp"/&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Clear Current Number of Sneezes"
          android:id="@+id/clear"
          android:layout_marginBottom="13dp"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:id="@+id/record_num"
          android:layout_below="@+id/textView"
          android:layout_centerHorizontal="true"
          android:singleLine="false" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:text="Current Number of Sneezes:"
          android:id="@+id/currentLabel"
          android:layout_centerVertical="true"
          android:layout_alignRight="@+id/textView"
          android:layout_alignEnd="@+id/textView" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:layout_below="@+id/currentLabel"
          android:layout_alignLeft="@+id/record_num"
          android:layout_alignStart="@+id/record_num"
          android:layout_marginTop="21dp"
          android:id="@+id/current_num" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>