• Source
    1. package org.ramaacademy.splashscreen;
    2.  
    3. import android.app.Activity;
    4. import android.content.Intent;
    5. import android.os.Bundle;
    6.  
    7. /** * Created by fitrahramadhan on 8/19/15. */
    8.  
    9. public class SplashScreen extends Activity {
    10. Thread splashTread;
    11. @Override
    12. protected void onCreate(Bundle savedInstanceState) {
    13. super.onCreate(savedInstanceState);
    14. setContentView(R.layout.activity_splashscreen);
    15. Thread splashThread = new Thread() {
    16. @Override public void run() {
    17. try {
    18. sleep(1500);
    19. } catch (InterruptedException e) {
    20.  
    21. } finally {
    22. Intent i = new Intent(getApplicationContext(),MainActivity.class);
    23. startActivity(i);
    24. finish();
    25. }
    26. }
    27. };
    28. splashThread.start();
    29. }
    30. }