public void onCreate(Bundle savedInstanceState) {
Log.d(LOG, "onCreate:" + this);
super.onCreate(savedInstanceState);
-
+
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
// Don't auto-launch if this fails.
- prefs.edit().remove(C.INDEX_SHORT_NAME).commit();
+ prefs.edit().remove(C.DICT_FILE).commit();
setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
if(intent.getStringExtra(C.DICT_FILE) == null && (from != null || to != null))
{
Log.d(LOG, "DictSearch: from: " + from + " to " + to);
- List<DictionaryInfo> dicts = application.getDictionariesOnDevice();
+ List<DictionaryInfo> dicts = application.getDictionariesOnDevice(null);
for(DictionaryInfo info : dicts)
{
boolean hasFrom = from == null;
break;
}
}
- indexIndex %= dictionary.indices.size();
Log.d(LOG, "Loading index " + indexIndex);
index = dictionary.indices.get(indexIndex);
setListAdapter(new IndexAdapter(index));
// Cache some prefs.
wordList = new File(prefs.getString(getString(R.string.wordListFileKey),
- getString(R.string.wordListFileDefault)));
+ new File(application.getDictDir(), "wordList.txt").getAbsolutePath()));
saveOnlyFirstSubentry = prefs.getBoolean(getString(R.string.saveOnlyFirstSubentryKey),
false);
clickOpensContextMenu = prefs.getBoolean(getString(R.string.clickOpensContextMenuKey),
searchView = new SearchView(getSupportActionBar().getThemedContext());
searchView.setIconifiedByDefault(false);
- // searchView.setIconified(false); // puts the magifying glass in the
+ // searchView.setIconified(false); // puts the magnifying glass in the
// wrong place.
searchView.setQueryHint(getString(R.string.searchText));
searchView.setSubmitButtonEnabled(false);
dialog.setContentView(R.layout.select_dictionary_dialog);
dialog.setTitle(R.string.selectDictionary);
- final List<DictionaryInfo> installedDicts = application.getDictionariesOnDevice();
+ final List<DictionaryInfo> installedDicts = application.getDictionariesOnDevice(null);
ListView listView = (ListView) dialog.findViewById(android.R.id.list);
final Button button = new Button(listView.getContext());