Fix resources NotFoundException
This commit is contained in:
parent
a5163938c8
commit
55098b39e8
1 changed files with 7 additions and 4 deletions
|
@ -379,12 +379,15 @@ public class QuickSearchListItem {
|
||||||
iconId = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
|
iconId = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (iconId <= 1) {
|
if (iconId <= 0) {
|
||||||
return app.getIconsCache().getIcon(SearchHistoryFragment.getItemIcon(entry.getName()),
|
iconId = SearchHistoryFragment.getItemIcon(entry.getName());
|
||||||
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
|
}
|
||||||
} else {
|
try {
|
||||||
return app.getIconsCache().getIcon(iconId,
|
return app.getIconsCache().getIcon(iconId,
|
||||||
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
|
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:
|
case WPT:
|
||||||
WptPt wpt = (WptPt) searchResult.object;
|
WptPt wpt = (WptPt) searchResult.object;
|
||||||
|
|
Loading…
Reference in a new issue