diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index 3f0a78cce..993cff923 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -210,17 +210,12 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener { } override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.cab_delete -> { - deleteEvent() - true - } - R.id.save -> { - saveEvent() - true - } - else -> super.onOptionsItemSelected(item) + when (item.itemId) { + R.id.cab_delete -> deleteEvent() + R.id.save -> saveEvent() + else -> return super.onOptionsItemSelected(item) } + return true } private fun deleteEvent() { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index 64efae90e..33f2b8d54 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -58,21 +58,13 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener { } override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.change_view -> { - showViewDialog() - true - } - R.id.settings -> { - startActivity(Intent(applicationContext, SettingsActivity::class.java)) - true - } - R.id.about -> { - startActivity(Intent(applicationContext, AboutActivity::class.java)) - true - } - else -> super.onOptionsItemSelected(item) + when (item.itemId) { + R.id.change_view -> showViewDialog() + R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java)) + R.id.about -> startActivity(Intent(applicationContext, AboutActivity::class.java)) + else -> return super.onOptionsItemSelected(item) } + return true } override fun onBackPressed() {