Donggyu1998

Untitled

Jun 7th, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import androidx.appcompat.app.AppCompatActivity
  2. import android.os.Bundle
  3.  
  4. class SplashActivity : AppCompatActivity() {
  5. override fun onCreate(savedInstanceState: Bundle?) {
  6. super.onCreate(savedInstanceState)
  7. setContentView(R.layout.activity_splash)
  8.  
  9. Handler().postDelayed({
  10. val intent = Intent(this, MainActivity::class.java)
  11. intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
  12. startActivity(intent)
  13. finish()
  14. },DURATION)
  15.  
  16. }
  17. companion object {
  18. private const val DURATION : Long = 3000
  19. }
  20.  
  21. override fun onBackPressed() {
  22. super.onBackPressed()
  23. }
  24. }
Add Comment
Please, Sign In to add comment