From: Reimar Döffinger Date: Sat, 12 Dec 2015 17:41:18 +0000 (+0100) Subject: Make updating the dictionary list more robust. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=62cf8d49e42297c05582c627d0c31d4b88d73c1d Make updating the dictionary list more robust. It should be updated even if we fail to persist the config. --- diff --git a/src/com/hughes/android/dictionary/DictionaryApplication.java b/src/com/hughes/android/dictionary/DictionaryApplication.java index 5470b81..b8022ce 100644 --- a/src/com/hughes/android/dictionary/DictionaryApplication.java +++ b/src/com/hughes/android/dictionary/DictionaryApplication.java @@ -634,8 +634,13 @@ public class DictionaryApplication extends Application { newDictionaryConfig.dictionaryFilesOrdered.addAll(toAddSorted); } - PersistentObjectCache.getInstance() - .write(C.DICTIONARY_CONFIGS, newDictionaryConfig); + try { + PersistentObjectCache.getInstance() + .write(C.DICTIONARY_CONFIGS, newDictionaryConfig); + } catch (Exception e) { + Log.e(LOG, "Failed persisting dictionary configs", e); + } + synchronized (this) { dictionaryConfig = newDictionaryConfig; }