Skip to content

Commit

Permalink
resolve bugs at MainActivity.kt (add onBackPressed())
Browse files Browse the repository at this point in the history
  • Loading branch information
riyandifirman committed Mar 5, 2023
1 parent 365ff97 commit d87c1da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ class MainActivity : AppCompatActivity() {
}
return super.onOptionsItemSelected(item)
}

// Method untuk menutup aplikasi ketika tombol back ditekan
override fun onBackPressed() {
finishAffinity()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SplashScreenActivity : AppCompatActivity() {
var image = binding.ivSplashScreenIcon
image.alpha = 0f
// Durasi animasi
image.animate().setDuration(4000).alpha(1f).withEndAction {
image.animate().setDuration(2000).alpha(1f).withEndAction {
// Intent
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
Expand Down

0 comments on commit d87c1da

Please sign in to comment.