Advertisement
euis_kusesa

SplashScreen

Dec 24th, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. package com.example.asusx441n.examplelistviewdinamis;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.support.v7.app.AppCompatActivity;
  6. import android.os.Bundle;
  7.  
  8. public class SplashScreen extends Activity {
  9.  
  10.     @Override
  11.     protected void onCreate(Bundle savedInstanceState) {
  12.         super.onCreate(savedInstanceState);
  13.         setContentView(R.layout.activity_splash_screen);
  14.  
  15.         Thread thread = new Thread(){
  16.             public void run() {
  17.                 try {
  18.                     sleep(3000);
  19.                 }catch (InterruptedException e){
  20.                     e.printStackTrace();
  21.                 }finally {
  22.                     startActivity(new Intent(SplashScreen.this, MainActivity.class));
  23.                     SplashScreen.this.finish();
  24.                 }
  25.             }
  26.         };
  27.         thread.start();
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement