From 70cc6094aba7fcef187282975bc44a511d0b24c5 Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 12 Feb 2019 19:34:28 +0800 Subject: [PATCH] Fix yes in onBackPressed --- .../com/github/shadowsocks/plugin/v2ray/ConfigActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigActivity.kt b/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigActivity.kt index 0d523b9..cab4bbb 100644 --- a/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigActivity.kt +++ b/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigActivity.kt @@ -60,7 +60,10 @@ class ConfigActivity : ConfigurationActivity(), Toolbar.OnMenuItemClickListener override fun onBackPressed() { if (child.options != oldOptions) AlertDialog.Builder(this).run { setTitle(R.string.unsaved_changes_prompt) - setPositiveButton(R.string.yes) { _, _ -> saveChanges(child.options) } + setPositiveButton(R.string.yes) { _, _ -> + saveChanges(child.options) + finish() + } setNegativeButton(R.string.no) { _, _ -> finish() } setNeutralButton(android.R.string.cancel, null) create()