Fix search crash
This commit is contained in:
parent
7d1fc07e2e
commit
236c2a458f
1 changed files with 12 additions and 12 deletions
|
@ -1308,20 +1308,20 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reloadHistoryInternal() {
|
private void reloadHistoryInternal() {
|
||||||
try {
|
if (historySearchFragment != null) {
|
||||||
LOG.info("+++ start loading history");
|
try {
|
||||||
SearchResultCollection res = searchUICore.shallowSearch(SearchHistoryAPI.class, "", null);
|
SearchResultCollection res = searchUICore.shallowSearch(SearchHistoryAPI.class, "", null);
|
||||||
List<QuickSearchListItem> rows = new ArrayList<>();
|
List<QuickSearchListItem> rows = new ArrayList<>();
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
for (SearchResult sr : res.getCurrentSearchResults()) {
|
for (SearchResult sr : res.getCurrentSearchResults()) {
|
||||||
rows.add(new QuickSearchListItem(app, sr));
|
rows.add(new QuickSearchListItem(app, sr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
historySearchFragment.updateListAdapter(rows, false);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
app.showToastMessage(e.getMessage());
|
||||||
}
|
}
|
||||||
historySearchFragment.updateListAdapter(rows, false);
|
|
||||||
LOG.info("--- history loaded: count=" + rows.size());
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
app.showToastMessage(e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue