X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2FDictionaryActivity.java;h=0bfd39ac1c1687cc81586328e80bf9668f29791c;hb=f42ffbb78f720a0088e83859bdcce20ed43f0a89;hp=155a15cad207653f24cdbfa5c8b0d873fb6fd817;hpb=97dc697f9956cf48bff464b9e296bfcc6b7a4000;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 155a15c..0bfd39a 100755 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -205,7 +205,10 @@ public class DictionaryActivity extends ListActivity { private void closeCurrentDictionary() { Log.i(LOG, "closeCurrentDictionary"); - searchOperation.stopAndWait(); + if (searchOperation != null) { + searchOperation.stopAndWait(); + searchOperation = null; + } languageList = null; setListAdapter(null); dictionary = null; @@ -313,6 +316,7 @@ public class DictionaryActivity extends ListActivity { languageList = new LanguageListAdapter( dictionary.languageDatas[(languageList.languageData == dictionary.languageDatas[0]) ? 1 : 0]); + Log.d(LOG, "onLanguageButton, newLang=" + languageList.languageData.language.symbol); setListAdapter(languageList); updateLangButton(); onSearchTextChange(searchText.getText().toString()); @@ -327,8 +331,10 @@ public class DictionaryActivity extends ListActivity { if (selectedRowIndex == selectedTokenRowIndex && selectedRowIndex > 0) { destRowIndex = languageList.languageData.sortedIndex .get(prevTokenIndex).startRow; + Log.d(LOG, "onUpButton, jumping back a word, destRowIndex=" + destRowIndex); } else { destRowIndex = selectedTokenRowIndex; + Log.d(LOG, "onUpButton, jumping to top of word, destRowIndex=" + destRowIndex); } jumpToRow(languageList, destRowIndex); } @@ -342,8 +348,10 @@ public class DictionaryActivity extends ListActivity { if (nextTokenIndex < languageList.languageData.sortedIndex.size()) { destRowIndex = languageList.languageData.sortedIndex .get(nextTokenIndex).startRow; + Log.d(LOG, "onDownButton, jumping down a word, destRowIndex=" + destRowIndex); } else { destRowIndex = languageList.languageData.rows.size() - 1; + Log.d(LOG, "onDownButton, jumping to end of dict, destRowIndex=" + destRowIndex); } jumpToRow(languageList, destRowIndex); }