title: java.lang.RuntimeException: Unable to start activity ComponentInfo Android Eclipse
body: <p>I know a bunch of people have asked this same thing but I just don't know what's going on. I'm trying to make a calculator in Eclipse, but I keep getting a list of errors.
  There are no errors in the file that the program notices, although there is an error in the layout.xml but it hasn't caused a problem before so that shouldn't cause a problem.</p>
  
  <pre><code>07-30 08:19:50.470: D/AndroidRuntime(2071): Shutting down VM
  07-30 08:19:50.470: W/dalvikvm(2071): threadid=1: thread exiting with uncaught
  exception (group=0x40a421f8)
  07-30 08:19:50.480: E/AndroidRuntime(2071): FATAL EXCEPTION: main
  07-30 08:19:50.480: E/AndroidRuntime(2071): java.lang.RuntimeException: Unable to start
  activity
  ComponentInfo{com.example.se.miun.chris.calculator/com.example.se.miun.chris.
  calculator.MainActivity}: java.lang.NullPointerException
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread.access$600(ActivityThread.java:123)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.os.Handler.dispatchMessage(Handler.java:99)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.os.Looper.loop(Looper.java:137)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread.main(ActivityThread.java:4424)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  java.lang.reflect.Method.invokeNative(Native Method)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  java.lang.reflect.Method.invoke(Method.java:511)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  dalvik.system.NativeStart.main(Native Method)
  07-30 08:19:50.480: E/AndroidRuntime(2071): Caused by: java.lang.NullPointerException
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  com.example.se.miun.chris.calculator.MainActivity.onCreate(MainActivity.java:60)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.Activity.performCreate(Activity.java:4465)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  07-30 08:19:50.480: E/AndroidRuntime(2071):     ... 11 more
  </code></pre>
  
  <p>This is my coding. It doesn't really do anything yet, but I wanted to just run it to see if it encountered any errors. This is the mainActivity.java file.</p>
  
  <pre><code>import android.os.Bundle;
  import android.app.Activity;
  import android.text.Editable;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  
  public class MainActivity extends Activity implements OnClickListener {
  Button Seven;
  Button Eight;
  Button Nine;
  Button Four;
  Button Five;
  Button Six;
  Button One;
  Button Two;
  Button Three;
  Button Zero;
  Button Point;
  Button Negative;
  TextView TextBox;
  int x;
  int y;
  String z;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Seven = (Button)findViewById(R.id.NumberSeven);
      Seven.setOnClickListener(this);
      Eight = (Button)findViewById(R.id.NumberEight);
      Eight.setOnClickListener(this);
      Nine = (Button)findViewById(R.id.NumberNine);
      Nine.setOnClickListener(this);
      Four = (Button)findViewById(R.id.NumberFour);
      Four.setOnClickListener(this);
      Five = (Button)findViewById(R.id.NumberFive);
      Five.setOnClickListener(this);
      Six = (Button)findViewById(R.id.NumberSix);
      Six.setOnClickListener(this);
      One = (Button)findViewById(R.id.NumberOne);
      One.setOnClickListener(this);
      Two = (Button)findViewById(R.id.NumberTwo);
      Two.setOnClickListener(this);
      Three = (Button)findViewById(R.id.NumberThree);
      Three.setOnClickListener(this);
      Zero = (Button)findViewById(R.id.NumberZero);
      Zero.setOnClickListener(this);
      Point = (Button)findViewById(R.id.Point);
      Point.setOnClickListener(this);
      Negative = (Button)findViewById(R.id.NNegative);
      Negative.setOnClickListener(this);
      TextBox = (TextView)findViewById(R.id.Screen);
      x = (Integer) null;
      y = (Integer) null;
  
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_main, menu);
      return true;
  }
  
  public void onClick(View One) {
      if(z == null){
          x = 1;
              TextBox.setText(x);
              TextBox.setText("diggity");
          }
          else if(z != null) {
              y = 1;
              TextBox.setText(x);
              TextBox.setText(z);
              TextBox.setText(y);
          }
  
  
      }
  }
  </code></pre>