Commit d1a1eb68 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Explicitly finish when clicking the back arrow (default behavior re-instantiates MainActivity)

parent 6596cfaa
Pipeline #5095 passed with stage
in 1 minute and 53 seconds
...@@ -3,6 +3,7 @@ package com.frostnerd.smokescreen.activity ...@@ -3,6 +3,7 @@ package com.frostnerd.smokescreen.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.MenuItem
import com.frostnerd.lifecyclemanagement.BaseActivity import com.frostnerd.lifecyclemanagement.BaseActivity
import com.frostnerd.smokescreen.fragment.SettingsFragment import com.frostnerd.smokescreen.fragment.SettingsFragment
import com.frostnerd.smokescreen.getPreferences import com.frostnerd.smokescreen.getPreferences
...@@ -51,6 +52,13 @@ class SettingsActivity : BaseActivity() { ...@@ -51,6 +52,13 @@ class SettingsActivity : BaseActivity() {
}).commit() }).commit()
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return if(item.itemId == android.R.id.home) {
finish()
true
} else super.onOptionsItemSelected(item)
}
enum class Category { enum class Category {
GENERAL, NOTIFICATION, PIN, CACHE, LOGGING, IP, NETWORK, QUERIES GENERAL, NOTIFICATION, PIN, CACHE, LOGGING, IP, NETWORK, QUERIES
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment