title: Unfortunately ' App name ' has stopped working
body: <h2>I am a beginner in eclipse and i am trying to display my buttons but my app has stopped working and i dont know why. hope my doubts will be cleared. thanks in advance.</h2>
  
  <hr>
  
  <p><strong>my Log cat:</strong></p>
  
  <pre><code>  10-14 14:56:15.527: I/dalvikvm(1283): threadid=3: reacting to signal 3
  10-14 14:56:15.857: I/dalvikvm(1283): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:56:16.037: I/dalvikvm(1283): threadid=3: reacting to signal 3
  10-14 14:56:16.107: I/dalvikvm(1283): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:56:16.296: D/AndroidRuntime(1283): Shutting down VM
  10-14 14:56:16.296: W/dalvikvm(1283): threadid=1: thread exiting with uncaught exception (group=0x409bf1f8)
  10-14 14:56:16.316: E/AndroidRuntime(1283): FATAL EXCEPTION: main
  10-14 14:56:16.316: E/AndroidRuntime(1283): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lpu/com.example.lpu.MainActivity}: java.lang.NullPointerException
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.os.Looper.loop(Looper.java:137)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at java.lang.reflect.Method.invoke(Method.java:511)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at dalvik.system.NativeStart.main(Native Method)
  10-14 14:56:16.316: E/AndroidRuntime(1283): Caused by: java.lang.NullPointerException
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at com.example.lpu.MainActivity.onCreate(MainActivity.java:29)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.Activity.performCreate(Activity.java:4466)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  10-14 14:56:16.316: E/AndroidRuntime(1283):     ... 11 more
  10-14 14:56:16.547: I/dalvikvm(1283): threadid=3: reacting to signal 3
  10-14 14:56:16.577: I/dalvikvm(1283): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:56:16.866: I/dalvikvm(1283): threadid=3: reacting to signal 3
  10-14 14:56:16.886: I/dalvikvm(1283): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:06.806: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:07.136: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:07.277: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:07.407: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:07.736: D/dalvikvm(1330): GC_FOR_ALLOC freed 65K, 3% free 9119K/9347K, paused 78ms
  10-14 14:57:07.806: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:08.026: I/dalvikvm-heap(1330): Grow heap (frag case) to 16.883MB for 8294416-byte allocation
  10-14 14:57:08.087: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:08.207: D/dalvikvm(1330): GC_CONCURRENT freed 1K, 2% free 17217K/17479K, paused 6ms+19ms
  10-14 14:57:08.307: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:08.337: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:08.826: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:08.866: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:09.301: D/gralloc_goldfish(1330): Emulator without GPU emulation detected.
  10-14 14:57:09.316: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:09.357: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:12.797: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:12.849: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:13.306: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:13.326: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 14:57:18.666: I/dalvikvm(1330): threadid=3: reacting to signal 3
  10-14 14:57:18.697: I/dalvikvm(1330): Wrote stack traces to '/data/anr/traces.txt'
  10-14 15:01:11.557: I/dalvikvm(1371): threadid=3: reacting to signal 3
  10-14 15:01:11.807: I/dalvikvm(1371): Wrote stack traces to '/data/anr/traces.txt'
  10-14 15:01:12.046: I/dalvikvm(1371): threadid=3: reacting to signal 3
  10-14 15:01:12.097: I/dalvikvm(1371): Wrote stack traces to '/data/anr/traces.txt'
  10-14 15:01:12.137: D/AndroidRuntime(1371): Shutting down VM
  10-14 15:01:12.147: W/dalvikvm(1371): threadid=1: thread exiting with uncaught exception (group=0x409bf1f8)
  10-14 15:01:12.157: E/AndroidRuntime(1371): FATAL EXCEPTION: main
  10-14 15:01:12.157: E/AndroidRuntime(1371): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lpu/com.example.lpu.MainActivity}: java.lang.NullPointerException
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.os.Looper.loop(Looper.java:137)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at java.lang.reflect.Method.invoke(Method.java:511)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at dalvik.system.NativeStart.main(Native Method)
  10-14 15:01:12.157: E/AndroidRuntime(1371): Caused by: java.lang.NullPointerException
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at com.example.lpu.MainActivity.onCreate(MainActivity.java:29)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.Activity.performCreate(Activity.java:4466)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  10-14 15:01:12.157: E/AndroidRuntime(1371):     ... 11 more
  10-14 15:01:12.547: I/dalvikvm(1371): threadid=3: reacting to signal 3
  10-14 15:01:12.586: I/dalvikvm(1371): Wrote stack traces to '/data/anr/traces.txt'
  10-14 15:01:12.816: I/dalvikvm(1371): threadid=3: reacting to signal 3
  10-14 15:01:12.826: I/dalvikvm(1371): Wrote stack traces to '/data/anr/traces.txt'
  10-14 15:04:31.236: I/Process(1371): Sending signal. PID: 1371 SIG: 9
  </code></pre>
  
  <p><strong>xml file:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/game" &gt;
  
       &lt;TextView
          android:id="@+id/textView5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView4"
          android:layout_below="@+id/textView4"
          android:text="• Game Development"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13dp" /&gt;
  
      &lt;TextView
          android:id="@+id/textView6"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView5"
          android:layout_below="@+id/textView5"
          android:layout_marginTop="21dp"
          android:text="BS Information Technology major in"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="#FDFEFE"
          android:textSize="15dp"
          android:textStyle="bold|italic" /&gt;
  
      &lt;TextView
          android:id="@+id/textView7"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView6"
          android:layout_below="@+id/textView6"
          android:text="PACUCOA Level II Reaccredited Status)"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13dp"
          android:textStyle="italic" /&gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="12dp"
          android:layout_marginTop="18dp"
          android:text="COMPUTER STUDIES"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:textColor="#FDFEFE"
          android:textSize="20sp"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView1"
          android:layout_below="@+id/textView2"
          android:layout_marginTop="16dp"
          android:text="BS Computer Science major in"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="#FDFEFE"
          android:textSize="15dp"
          android:textStyle="bold|italic" /&gt;
  
      &lt;TextView
          android:id="@+id/textView4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView3"
          android:layout_below="@+id/textView3"
          android:layout_marginTop="14dp"
          android:text="• Mobile Application Development"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13dp" /&gt;
  
      &lt;TextView
          android:id="@+id/textView10"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView9"
          android:layout_below="@+id/textView9"
          android:layout_marginTop="16dp"
          android:text="Associate in Computer Technology"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="#FDFEFE"
          android:textStyle="bold|italic" /&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView1"
          android:layout_below="@+id/textView1"
          android:text="(Bs Computer Science - PACUCOA level III Reacrideted Status)"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13sp"
          android:textStyle="italic" /&gt;
  
      &lt;TextView
          android:id="@+id/textView9"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView8"
          android:layout_below="@+id/textView8"
          android:text="• Digital Animation"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13dp" /&gt;
  
      &lt;TextView
          android:id="@+id/textView8"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView7"
          android:layout_centerVertical="true"
          android:text="• Multimedia Technologies"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textSize="13dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Main Activity:</strong> </p>
  
  <pre><code>package com.example.lpu;
  
  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.ImageButton;
  
  public class MainActivity extends Activity implements OnClickListener {
  
      Button button1;
      Button button2;
      ImageButton imageButton1;
      Intent intent;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          button1 = (Button)findViewById(R.id.button1);
          button2 = (Button)findViewById(R.id.button2);
          imageButton1 = (ImageButton)findViewById(R.id.imageButton1);
  
          button1.setOnClickListener(this);
          button2.setOnClickListener(this);
          imageButton1.setOnClickListener(this);
  
      }
  
      @Override
      public void onClick(View v) {
          // TODO Auto-generated method stub
      switch (v.getId()) {
      case R.id.button1:
          Intent intent = new Intent(MainActivity.this,BUTTON.class);
          this.startActivity(intent);
          break;
  
      case R.id.button2:
          Intent intent2 = new Intent(MainActivity.this,BUTOON.class);
          this.startActivity(intent2);
          break;
  
      case R.id.imageButton1:
          Intent intent3 = new Intent(MainActivity.this,CCS.class);
          this.startActivity(intent3);
          break;
      }
  
      }
  }
  </code></pre>
  
  <p><strong>here is the Android Manifest</strong></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.lpu"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="15"
          android:targetSdkVersion="15" /&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=".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=".BUTTON"&gt;&lt;/activity&gt;
          &lt;activity android:name=".BUTOON"&gt;&lt;/activity&gt;
          &lt;activity android:name=".CCS"&gt;&lt;/activity&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>