Fix exceptions
This commit is contained in:
parent
5dae3f749b
commit
f47c371c32
2 changed files with 16 additions and 6 deletions
|
@ -20,6 +20,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.activities.SettingsActivity;
|
||||
import net.osmand.plus.activities.TransportRouteHelper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.plus.views.corenative.NativeCoreContext;
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
@ -429,13 +430,13 @@ public class ConfigureMapMenu {
|
|||
protected String getDescription(final List<OsmandSettings.CommonPreference<Boolean>> prefs) {
|
||||
int count = 0;
|
||||
int enabled = 0;
|
||||
for(OsmandSettings.CommonPreference<Boolean> p : prefs) {
|
||||
count ++;
|
||||
if(p.get()) {
|
||||
for (OsmandSettings.CommonPreference<Boolean> p : prefs) {
|
||||
count++;
|
||||
if (p.get()) {
|
||||
enabled++;
|
||||
}
|
||||
}
|
||||
final String descr = enabled +"/"+count;
|
||||
final String descr = enabled + "/" + count;
|
||||
return descr;
|
||||
}
|
||||
|
||||
|
@ -487,7 +488,12 @@ public class ConfigureMapMenu {
|
|||
}
|
||||
|
||||
protected String getRenderDescr(final MapActivity activity) {
|
||||
return activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer().getName();
|
||||
RendererRegistry rr = activity.getMyApplication().getRendererRegistry();
|
||||
RenderingRulesStorage storage = rr.getCurrentSelectedRenderer();
|
||||
if (storage == null) {
|
||||
return "";
|
||||
}
|
||||
return storage.getName();
|
||||
}
|
||||
|
||||
protected String getDayNightDescr(final MapActivity activity) {
|
||||
|
|
|
@ -154,7 +154,11 @@ public class SelectedGPXFragment extends ListFragment {
|
|||
protected void updateContent() {
|
||||
adapter.clear();
|
||||
List<GpxSelectionHelper.GpxDisplayGroup> groups = filterGroups(filterType());
|
||||
adapter.addAll(flatten(groups));
|
||||
adapter.setNotifyOnChange(false);
|
||||
for(GpxDisplayItem i: flatten(groups)) {
|
||||
adapter.add(i);
|
||||
}
|
||||
adapter.setNotifyOnChange(true);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue