]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Always set and unset DICT_FILE and INDEX_SHORT_NAME together.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 1 Nov 2017 22:12:31 +0000 (23:12 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 1 Nov 2017 22:13:05 +0000 (23:13 +0100)
src/com/hughes/android/dictionary/DictionaryActivity.java
src/com/hughes/android/dictionary/DictionaryManagerActivity.java

index 8df2a2601ac2178b17503f1b96cf9076aff0dd7e..52a6991cdc00d5d1c264f400a85d7bcfe2f225a1 100644 (file)
@@ -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);
 
index 5264248171c5b33def0dc102f344a71cc94d3f84..a328b982f0a05a8f0911cd6adceb62ca40869a10 100644 (file)
@@ -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);