-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSplashScreen.kt
More file actions
32 lines (23 loc) · 818 Bytes
/
SplashScreen.kt
File metadata and controls
32 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.example.myapplication.ui
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import com.example.myapplication.R
class SplashScreen : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash_screen)
//this will setup the animation and create a intent to move on to the next screen
animationSetup()
}
fun animationSetup(){
val handler = Handler()
handler.postDelayed(Runnable {
//Intent for activty
val intent = Intent(this@SplashScreen, MainActivity::class.java)
startActivity(intent)
finish()
},2000)
}
}