I am trying to change the code of the Searchable Dictionary example (full code here), so that I can modify “description.txt” and it will update it when I build the program from Eclipse to my application.
I think it doesn’t take the modifications into account after the first time because the dictionary is already loaded, with this function:
private void loadDictionary() {
new Thread(new Runnable() {
public void run() {
try {
loadWords();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}).start();
}
Anybody knows how to change this, so that it always load the new “definition.txt” and that I can keep modifying it without having to reinstall the app all the time?
In this specific code, the solution was to increment the database version in DictionaryDatabase.java:
private static final int DATABASE_VERSION = 3;