NullPointerException
<p>I released a free app image slider with spoken words for small kids. Weeks ago, I got the first crash report. This seems to happen only rarely (once a week).</p>

<p>The report states: NullPointerException in Splash.onCreate()</p>

<p>Stack tace shows this messages:</p>

<pre><code>java.lang.RuntimeException: Unable to start activity 
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at co.uk.musenuovo.michal.Splash.onCreate(Splash.java:18)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
</code></pre>

<p>My code in spash activity (intial screen displaying image and playing tune for 5 seconds):</p>

<pre><code>import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class Splash extends Activity {

    MediaPlayer ourSong;

    @Override
    protected void onCreate(Bundle ShowSplashPage) {
        // TODO Auto-generated method stub
        super.onCreate(ShowSplashPage);
        setContentView(R.layout.splash);
        ourSong = MediaPlayer.create(Splash.this, R.raw.xylophone_open);
        ourSong.start();
        Thread timer = new Thread(){

            public void run(){
                try{
                    sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } finally {
                    Intent openStartingPoint = new Intent("co.uk.musenuovo.michal.STARTINGPOINT");
                    startActivity(openStartingPoint);

                }
            }

        };
        timer.start();

    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        ourSong.release();
        finish();
    }

}
</code></pre>

<p>The error clearly points to onstart in spash activity. Is this because I forgot to import some library? or did I forgot to assign something? I am very new to java and do not know how to debug and find out what is the problem. I read a lot about NullPointerException but this seems to be so vague of an error. Thank you for all your help.</p>
