title: Null pointer exception. cant run my android application
body: <p>Please help me fix my android app. this happens when i run it in the emulator. cant seem to find the answer to these errors.</p>
  
  <p>here is my logcat</p>
  
  <pre><code>04-10 17:37:56.283: E/AndroidRuntime(2177): FATAL EXCEPTION: main
  04-10 17:37:56.283: E/AndroidRuntime(2177): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.miraapp/com.example.miraapp.MainActivity}: java.lang.NullPointerException
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.os.Handler.dispatchMessage(Handler.java:99)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.os.Looper.loop(Looper.java:137)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread.main(ActivityThread.java:5041)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at java.lang.reflect.Method.invoke(Method.java:511)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at dalvik.system.NativeStart.main(Native Method)
  04-10 17:37:56.283: E/AndroidRuntime(2177): Caused by: java.lang.NullPointerException
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at com.example.miraapp.MainActivity.onCreate(MainActivity.java:30)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.Activity.performCreate(Activity.java:5104)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  04-10 17:37:56.283: E/AndroidRuntime(2177):     ... 11 more
  </code></pre>
  
  <p>here is my MainActivity from the main</p>
  
  <pre><code>package com.example.miraapp;
  
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
   public class MainActivity extends Activity implements OnClickListener
  {
  
  
  Button button1;
  EditText etResponse;
      TextView tvIsConnected;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      button1 = (Button) findViewById(R.id.button1);
      button1.setOnClickListener(this); 
  
  
  }
  
  private void button1Click()
  {
      startActivity(new Intent(this,GUI.class));  
  }
  public void onClick(View v)
  {
  
      switch (v.getId())
      {
          case R.id.button1:
              button1Click();
              break;
          case R.id.button2:
              button2Click();
              break;
      }
  }
  
  private void button2Click()
  {
  
  
  }
  
  };
  </code></pre>
  
  <p>here is my manifest.xml </p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.miraapp"
  android:versionCode="1"
  android:versionName="1.0"
   &gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  &lt;uses-sdk
      android:minSdkVersion="10"
      android:targetSdkVersion="17"
  
   /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.miraapp.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
       &lt;activity
          android:name="com.example.miraapp.GUI"
          android:label="@string/app_name" &gt;
      &lt;/activity&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>here is my fragment_main</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:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:background="#000000"
  tools:context="com.example.miraapp.MainActivity$PlaceholderFragment" &gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="131dp"
      android:text="@string/START_fix" 
      android:onClick="button1Click"/&gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/button1"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="29dp"
      android:contentDescription="@string/title_fix"
      android:src="@drawable/mira4" /&gt;
  
  &lt;Button
      android:id="@+id/button2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="63dp"
      android:text="@string/CONNECT_fix" /&gt;
  
   &lt;/RelativeLayout&gt;
  </code></pre>