Splash screen Android App has stopped
<p>I want to make a splash screen for my android app. I have written following codes in welcomescreen.java in android studio. But after running the app, the app has stopped. :( What shall I Do now?</p>

<pre><code>package com.mateors.welcomescreen;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class WelcomeScreen extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_welcome_screen);
    Thread myThread = new Thread(){
        @Override
        public void run() {
            try {
                sleep(5000);
                Intent intent = new Intent(getApplicationContext(), MainActivity.class);
                startActivity(intent);
                finish();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    };
    myThread.start();
}
}
</code></pre>