Fix resources NotFoundException

This commit is contained in:
Alexey Kulish 2017-05-19 19:09:02 +03:00
parent a5163938c8
commit 55098b39e8

View file

@ -379,12 +379,15 @@ public class QuickSearchListItem {
iconId = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
}
}
if (iconId <= 1) {
return app.getIconsCache().getIcon(SearchHistoryFragment.getItemIcon(entry.getName()),
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
} else {
if (iconId <= 0) {
iconId = SearchHistoryFragment.getItemIcon(entry.getName());
}
try {
return app.getIconsCache().getIcon(iconId,
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
} catch (Exception e) {
return app.getIconsCache().getIcon(SearchHistoryFragment.getItemIcon(entry.getName()),
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
}
case WPT:
WptPt wpt = (WptPt) searchResult.object;