Guest User

Untitled

a guest
Mar 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import android.app.Activity;
  2. import android.content.Intent;
  3. import android.os.Bundle;
  4. import android.os.Handler;
  5.  
  6. public class Splash extends Activity {
  7.  
  8. /** Duration of wait **/
  9. private final int SPLASH_DISPLAY_LENGTH = 1000;
  10.  
  11. /** Called when the activity is first created. */
  12. @Override
  13. public void onCreate(Bundle icicle) {
  14. super.onCreate(icicle);
  15. setContentView(R.layout.splashscreen);
  16.  
  17. /* New Handler to start the Menu-Activity
  18. * and close this Splash-Screen after some seconds.*/
  19. new Handler().postDelayed(new Runnable(){
  20. @Override
  21. public void run() {
  22. /* Create an Intent that will start the Menu-Activity. */
  23. Intent mainIntent = new Intent(Splash.this,Menu.class);
  24. Splash.this.startActivity(mainIntent);
  25. Splash.this.finish();
  26. }
  27. }, SPLASH_DISPLAY_LENGTH);
  28. }
  29. }
Add Comment
Please, Sign In to add comment