Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SplashScreenActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_splash_screen)
- // hide app bar
- supportActionBar?.hide()
- // jalankan fungsi update progress
- updateProgress()
- }
- private fun updateProgress(){
- var handler = Handler()
- var run = Runnable {
- var progress: Int = progressbar.progress
- progressbar.progress = progress + 10
- if (progress < 100){
- updateProgress()
- } else {
- val intent = Intent(this, LoginActivity::class.java)
- startActivity(intent)
- finish()
- }
- }
- handler.postDelayed(run, 300)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement