From c472c05249f8428c447225a89178ef3e7e557ecc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 14 Oct 2015 16:45:10 +0200 Subject: [PATCH] Fix crash --- OsmAnd/src/net/osmand/plus/ApplicationMode.java | 2 -- .../src/net/osmand/plus/download/UpdatesIndexFragment.java | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java index db06ec6a9c..35dba1e129 100644 --- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java @@ -16,7 +16,6 @@ public class ApplicationMode { private static Map> widgets = new LinkedHashMap>(); private static List values = new ArrayList(); private static List cachedFilteredValues = new ArrayList(); - private static boolean listenerRegistered = false; /* * DEFAULT("Browse map"), CAR("Car"), BICYCLE("Bicycle"), PEDESTRIAN("Pedestrian"); */ @@ -51,7 +50,6 @@ public class ApplicationMode { static { ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[] { CAR, BICYCLE, BOAT, AIRCRAFT }; - ApplicationMode[] exceptAirBoat = new ApplicationMode[] { DEFAULT, CAR, BICYCLE, PEDESTRIAN }; ApplicationMode[] exceptAirBoatDefault = new ApplicationMode[] { CAR, BICYCLE, PEDESTRIAN }; ApplicationMode[] pedestrian = new ApplicationMode[] { PEDESTRIAN }; ApplicationMode[] pedestrianBicycle = new ApplicationMode[] { PEDESTRIAN, BICYCLE }; diff --git a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java index c231c1bdd5..e97cbcd447 100644 --- a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java @@ -39,7 +39,6 @@ import java.util.Map; * on 09.09.2014. */ public class UpdatesIndexFragment extends OsmAndListFragment { - private OsmandRegions osmandRegions; private UpdateIndexAdapter listAdapter; List indexItems = new ArrayList<>(); @@ -84,6 +83,8 @@ public class UpdatesIndexFragment extends OsmAndListFragment { indexItems.add(new IndexItem(getString(R.string.no_index_file_to_download), "", 0, "", 0, 0, null)); } } + final OsmandRegions osmandRegions = + getMyApplication().getResourceManager().getOsmandRegions(); listAdapter = new UpdateIndexAdapter(getMyActivity(), R.layout.download_index_list_item, indexItems); listAdapter.sort(new Comparator() { @Override @@ -247,6 +248,8 @@ public class UpdatesIndexFragment extends OsmAndListFragment { for (IndexItem item : filtered) { add(item); } + final OsmandRegions osmandRegions = + getMyApplication().getResourceManager().getOsmandRegions(); sort(new Comparator() { @Override public int compare(IndexItem indexItem, IndexItem indexItem2) {