From: Reimar Döffinger Date: Wed, 1 Nov 2017 22:12:31 +0000 (+0100) Subject: Always set and unset DICT_FILE and INDEX_SHORT_NAME together. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=18ffe80c53a884c26f6831992890b9cedbd792bf Always set and unset DICT_FILE and INDEX_SHORT_NAME together. --- diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 8df2a26..52a6991 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -257,7 +257,7 @@ public class DictionaryActivity extends ActionBarActivity { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); // Don't auto-launch if this fails. - prefs.edit().remove(C.DICT_FILE).commit(); + prefs.edit().remove(C.DICT_FILE).remove(C.INDEX_SHORT_NAME).commit(); setContentView(R.layout.dictionary_activity); diff --git a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java index 5264248..a328b98 100644 --- a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java @@ -475,10 +475,7 @@ public class DictionaryManagerActivity extends ActionBarActivity { // Remove the active dictionary from the prefs so we won't autolaunch // next time. - final Editor editor = prefs.edit(); - editor.remove(C.DICT_FILE); - editor.remove(C.INDEX_SHORT_NAME); - editor.commit(); + prefs.edit().remove(C.DICT_FILE).remove(C.INDEX_SHORT_NAME).commit(); application.backgroundUpdateDictionaries(dictionaryUpdater);