Fix crash

This commit is contained in:
Victor Shcherb 2015-10-14 16:45:10 +02:00
parent 893245555d
commit c472c05249
2 changed files with 4 additions and 3 deletions

View file

@ -16,7 +16,6 @@ public class ApplicationMode {
private static Map<String, Set<ApplicationMode>> widgets = new LinkedHashMap<String, Set<ApplicationMode>>();
private static List<ApplicationMode> values = new ArrayList<ApplicationMode>();
private static List<ApplicationMode> cachedFilteredValues = new ArrayList<ApplicationMode>();
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 };

View file

@ -39,7 +39,6 @@ import java.util.Map;
* on 09.09.2014.
*/
public class UpdatesIndexFragment extends OsmAndListFragment {
private OsmandRegions osmandRegions;
private UpdateIndexAdapter listAdapter;
List<IndexItem> 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<IndexItem>() {
@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<IndexItem>() {
@Override
public int compare(IndexItem indexItem, IndexItem indexItem2) {