title: Eclipse(Android) - unfortunately HelloWorld has stopped working
body: <p>I get that error message everytime I try running my program. I have a fairly simple program, with two buttons. If you press one button it subtracts 1 from a number. If you press the add button it adds 1 to the number. I have no compiling errors and I'm fairly new to android. Any help would be great... Thanks!</p>
  
  <p>Here is my code: (The main activity).</p>
  
  <pre><code>package com.example.helloworld;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  public class MainActivity extends Activity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          TextView numberText = (TextView) findViewById(R.id.number);
          numberText.setText(String.valueOf(0));
  
          Button.OnClickListener listenerAdd = new Button.OnClickListener() {
              @Override 
              public void onClick(View v) {
                  TextView numberText = (TextView) findViewById(R.id.number);
                  switch(v.getId()) {
                      case R.id.HomeScreenChangeAdd: {
                          String currText = numberText.getText().toString();
                          int curNumb = Integer.parseInt(currText);
                          int newNumb = curNumb +1;
                          String newText = String.valueOf(newNumb);
                          numberText.setText(newText);
                          break;
                      }
                  }
              }
          };
  
          Button.OnClickListener listenerSub = new Button.OnClickListener() {
              @Override 
              public void onClick(View v) {
                  TextView numberText = (TextView) findViewById(R.id.number);
                  switch(v.getId()) {
                      case R.id.HomeScreenChangeSub: {
                          String currText = numberText.getText().toString();
                          int curNumb = Integer.parseInt(currText);
                          int newNumb = curNumb -1;
                          String newText = String.valueOf(newNumb);
                          numberText.setText(newText);
                          break;
                      }
                  }
              }
          };
  
          ((Button) findViewById(R.id.HomeScreenChangeAdd)).setOnClickListener(listenerAdd);
          ((Button) findViewById(R.id.HomeScreenChangeSub)).setOnClickListener(listenerSub);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  }
  </code></pre>