Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2. import android.support.v7.app.AppCompatActivity;
  3. import android.os.Bundle;
  4. import android.content.Intent;
  5. import android.os.Handler;
  6.  
  7.  
  8. public class Splash extends AppCompatActivity {
  9. private static int display_time = 3000;
  10.  
  11. @Override
  12. protected void onCreate(Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.activity_splash);
  15.  
  16. new Handler().postDelayed(new Runnable() {
  17.  
  18.  
  19. //Showing splash screen with a timer.
  20. @Override
  21. public void run() {
  22. Intent nextScreen = new Intent(getApplicationContext(), HomeScreen.class);
  23. startActivity(nextScreen);
  24. finish();
  25. }
  26. }, display_time);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement