From b786c4b1e645d8d0c40ba30c821d698e7637aadc Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Mon, 13 May 2024 17:34:21 +0000 Subject: [PATCH] Android: Remember last entered Artic Base server address --- .../github/lime3ds/android/fragments/HomeSettingsFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt index d1d479a43..aef564c23 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt @@ -89,7 +89,7 @@ class HomeSettingsFragment : Fragment() { { val inflater = LayoutInflater.from(context) val inputBinding = DialogSoftwareKeyboardBinding.inflate(inflater) - var textInputValue: String = "" + var textInputValue: String = preferences.getString("lastArticBaseAddr", "")!! inputBinding.editTextInput.setText(textInputValue) inputBinding.editTextInput.doOnTextChanged { text, _, _, _ -> @@ -102,6 +102,9 @@ class HomeSettingsFragment : Fragment() { .setTitle(getString(R.string.artic_base_enter_address)) .setPositiveButton(android.R.string.ok) { _, _ -> if (textInputValue.isNotEmpty()) { + preferences.edit() + .putString("lastArticBaseAddr", textInputValue) + .apply() val menu = Game( title = getString(R.string.artic_base), path = "articbase://$textInputValue",