From 7db6eafc81c441ce7b1dc2f8afd9e1706cc4fb66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 5 Nov 2017 20:54:02 +0100 Subject: [PATCH] Ensure there is no ListAdapter using the closed file. --- src/com/hughes/android/dictionary/DictionaryActivity.java | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- 2.43.0