hide keyboard before launching settings

This commit is contained in:
tibbi 2022-01-31 17:42:36 +01:00
parent 61560c8799
commit 6ecbba5b8d
2 changed files with 7 additions and 2 deletions

View File

@ -64,7 +64,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:91d4508df6'
implementation 'com.github.SimpleMobileTools:Simple-Commons:feb676128e'
kapt 'androidx.room:room-compiler:2.3.0'
implementation 'androidx.room:room-runtime:2.3.0'

View File

@ -55,13 +55,18 @@ class MainActivity : SimpleActivity() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java))
R.id.settings -> launchSettings()
R.id.about -> launchAbout()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun launchSettings() {
hideKeyboard()
startActivity(Intent(applicationContext, SettingsActivity::class.java))
}
private fun launchAbout() {
val licenses = LICENSE_GSON