tpbolon

Splash Screen ADT - SplashScreen.class

Jul 15th, 2020
1,013
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.membuatsplash;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.Window;
  7.  
  8. public class SplashScreen extends Activity{
  9. @Override
  10. protected void onCreate(Bundle savedInstanceState) {
  11.     // TODO Auto-generated method stub
  12.     super.onCreate(savedInstanceState);
  13.     this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  14.     setContentView(R.layout.splash);
  15.     Thread timer =new Thread(){
  16.         public void run(){
  17.             try {
  18.                 sleep(3500);
  19.             } catch (Exception e) {
  20.                 // TODO: handle exception
  21.                 e.printStackTrace();
  22.             } finally{
  23.                 finish();
  24.                 Intent lay2 =new Intent(SplashScreen.this, MainActivity.class);
  25.                 startActivityForResult(lay2, 0);
  26.             }
  27.         }
  28.     };
  29.     timer.start();
  30. }
  31. }
RAW Paste Data