Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFound when historyFile set to null #14

Closed
sddamico opened this issue Dec 17, 2015 · 1 comment
Closed

FileNotFound when historyFile set to null #14

sddamico opened this issue Dec 17, 2015 · 1 comment
Labels

Comments

@sddamico
Copy link
Member

From #11

E/MapsPlacesAutoComplete: Unable to load history from history file
E/MapsPlacesAutoComplete: java.io.FileNotFoundException: History file does not exist
E/MapsPlacesAutoComplete: at com.seatgeek.placesautocomplete.history.DefaultAutocompleteHistoryManager$1.executeInBackground(DefaultAutocompleteHistoryManager.java:68)
E/MapsPlacesAutoComplete: at com.seatgeek.placesautocomplete.history.DefaultAutocompleteHistoryManager$1.executeInBackground(DefaultAutocompleteHistoryManager.java:64)
E/MapsPlacesAutoComplete: at com.seatgeek.placesautocomplete.async.BackgroundExecutorService$2.run(BackgroundExecutorService.java:43)
E/MapsPlacesAutoComplete: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/MapsPlacesAutoComplete: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/MapsPlacesAutoComplete: at java.lang.Thread.run(Thread.java:818)
@sddamico sddamico added the bug label Dec 17, 2015
@sddamico sddamico mentioned this issue Dec 17, 2015
@MeinLieberScholli
Copy link

The problem is in the DefaultAutocompleteHistoryManager the line 36:
File historyFile = new File(context.getCacheDir(), BASE_AUTOCOMPLETE_HISTORY_DIR + historyFileName);
It won't creat the actual file in the filesystem.
Missing code is:
if (!historyFile.exists()) {
historyFile.mkdirs();
try {
historyFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}

sddamico added a commit that referenced this issue Apr 18, 2016
…s.emptyList() instead of throwing FNF since that's the expected behavior. Closes #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants