From 8639e508c921901e3ba875361711109e21ee075d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 9 Mar 2015 01:25:47 +0100 Subject: [PATCH] Fix crashes and poi search --- OsmAnd/res/values/strings.xml | 8 ++++---- OsmAnd/src/net/osmand/plus/AppInitializer.java | 5 ++++- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 2 +- OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 76220e3768..bbce14f5e1 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -75,11 +75,11 @@ Favorites Add Add to Favorites - My Location + My Location My Places - My Favorites - My Tracks - Currently recording track + My Favorites + My Tracks + Currently recording track Audio Video Photo diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index afd593bbd9..ea7948489f 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -378,6 +378,9 @@ public class AppInitializer implements IProgress { startBgTime = System.currentTimeMillis(); app.favorites.loadFavorites(); notifyEvent(InitEvents.FAVORITES_INITIALIZED); + // init poi types before indexes and before POI + initPoiTypes(); + app.resourceManager.reloadIndexesOnStart(this, warnings); app.resourceManager.initRenderers(this); @@ -386,7 +389,7 @@ public class AppInitializer implements IProgress { initNativeCore(); notifyEvent(InitEvents.NATIVE_INITIALIZED); - initPoiTypes(); + app.poiFilters.reloadAllPoiFilters(); notifyEvent(InitEvents.POI_TYPES_INITIALIZED); indexRegionsBoundaries(false); diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 56a4aa2822..0cff3f4a81 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -622,7 +622,7 @@ public class OsmandSettings { return p; } - public final CommonPreference USE_DASHBOARD_INSTEAD_OF_DRAWER = new BooleanPreference("use_dashboard_instead_of_drawer", false).makeGlobal().cache(); + public final CommonPreference USE_DASHBOARD_INSTEAD_OF_DRAWER = new BooleanPreference("use_dashboard_instead_of_drawer", true).makeGlobal().cache(); // this value string is synchronized with settings_pref.xml preference name public final CommonPreference USE_INTERNET_TO_DOWNLOAD_TILES = new BooleanPreference("use_internet_to_download_tiles", true).makeGlobal().cache(); diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java index cc9fc31704..7f9487fca8 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java @@ -207,6 +207,9 @@ public class PoiLegacyFilter { } public boolean acceptTypeSubtype(PoiCategory t, String subtype){ + if(t == null) { + return true; + } if(!poiTypes.isRegisteredType(t)) { t = poiTypes.getOtherPoiCategory(); }