title: Android app error "Unfortunately App has Stopped"
body: <p>I am learning android development and I am following a tutorial on youtube, and I am trying to run this code and I keep getting "Unfortunately App has Stopped", it looks that the problem is when i start the Activity "startActivity(menuIntent);" this is the MainActivity.java:</p>
  
  <pre><code>package com.example.thebasicseries;
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  
  
  public class MainActivity extends Activity {
  
  MediaPlayer logoMusic;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splash);
  
      logoMusic = MediaPlayer.create(MainActivity.this, R.raw.sound);
      logoMusic.start();
  
      Thread logoTimer = new Thread(){
          public void run(){
              try {
                  sleep(5000);
                  Intent menuIntent = new Intent("com.example.thebasicseries.menu");
                  startActivity(menuIntent);
              } catch (InterruptedException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } finally{
                  finish();
              }
          }
      };
      logoTimer.start();
  }
  
  @Override
  protected void onPause() {
      // TODO Auto-generated method stub
      super.onPause();
      logoMusic.release();
  }
  
  
   }
  </code></pre>
  
  <p>And this is the menu.java </p>
  
  <pre><code> package com.example.thebasicseries;
   import android.app.Activity;
   import android.content.Intent;
   import android.media.MediaPlayer;
   import android.os.Bundle;
   import android.view.View;
   import android.widget.Button;
  
   public class menu extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //Button sound
      final MediaPlayer buttonSound = MediaPlayer.create(menu.this, R.raw.button);
  
      //Setting up the button references
      Button tut1 = (Button) findViewById(R.id.tutorial1);
      Button tut2 = (Button) findViewById(R.id.tutorial2);
  
      tut1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              buttonSound.start();
              startActivity(new Intent("com.example.thebasicseries.TutorialOne"));
          }
      });     
  
  
      tut2.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              buttonSound.start();
              startActivity(new Intent("com.example.thebasicseries.TutorialOne"));
          }
      });     
  
  
  
  
  }
  
  @Override
  protected void onPause() {
      // TODO Auto-generated method stub
      super.onPause();
  }
  
    }
  </code></pre>
  
  <p>This is the manifest:</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.thebasicseries"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      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.thebasicseries.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.thebasicseries.menu"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.example.thebasicseries.menu" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.thebasicseries.TutorialOne"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.example.thebasicseries.TutorialOne" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>The error log is the following:</p>
  
  <pre><code>     04-20 11:13:29.780: E/AndroidRuntime(820): FATAL EXCEPTION: main
       04-20 11:13:29.780: E/AndroidRuntime(820): java.lang.RuntimeException: Unable to start   activity ComponentInfo{com.example.thebasicseries/com.example.thebasicseries.menu}: java.lang.NullPointerException
       04-20 11:13:29.780: E/AndroidRuntime(820):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
       04-20 11:13:29.780: E/AndroidRuntime(820):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
      04-20 11:13:29.780: E/AndroidRuntime(820):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at android.os.Handler.dispatchMessage(Handler.java:99)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at android.os.Looper.loop(Looper.java:137)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at android.app.ActivityThread.main(ActivityThread.java:5039)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at java.lang.reflect.Method.invokeNative(Native Method)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at java.lang.reflect.Method.invoke(Method.java:511)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
     04-20 11:13:29.780: E/AndroidRuntime(820):   at dalvik.system.NativeStart.main(Native Method)
     04-20 11:13:29.780: E/AndroidRuntime(820): Caused by: java.lang.NullPointerException
      04-20 11:13:29.780: E/AndroidRuntime(820):  at com.example.thebasicseries.menu.onCreate(menu.java:35)
      04-20 11:13:29.780: E/AndroidRuntime(820):  at android.app.Activity.performCreate(Activity.java:5104)
      04-20 11:13:29.780: E/AndroidRuntime(820):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
      04-20 11:13:29.780: E/AndroidRuntime(820):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
      04-20 11:13:29.780: E/AndroidRuntime(820):  ... 11 more
      04-20 11:13:33.220: I/Process(820): Sending signal. PID: 820 SIG: 9
  </code></pre>
  
  <p>Thanks!!
  `</p>