From: Reimar Döffinger Date: Sun, 5 Nov 2017 19:54:02 +0000 (+0100) Subject: Ensure there is no ListAdapter using the closed file. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=7db6eafc81c441ce7b1dc2f8afd9e1706cc4fb66 Ensure there is no ListAdapter using the closed file. --- diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index e63916c..863e20b 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -230,6 +230,8 @@ public class DictionaryActivity extends ActionBarActivity { private void dictionaryOpenFail(Exception e) { Log.e(LOG, "Unable to load dictionary.", e); if (dictRaf != null) { + indexAdapter = null; + setListAdapter(null); try { dictRaf.close(); } catch (IOException e1) { @@ -710,6 +712,9 @@ public class DictionaryActivity extends ActionBarActivity { textToSpeech.shutdown(); textToSpeech = null; + indexAdapter = null; + setListAdapter(null); + try { Log.d(LOG, "Closing RAF."); dictRaf.close();