diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java index 9bb7048e14..a2af444f0f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java @@ -187,14 +187,8 @@ public class EditFavoriteGroupDialogFragment extends BottomSheetDialogFragment { addToMarkersView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List points = new ArrayList<>(group.points.size()); - List names = new ArrayList<>(group.points.size()); - for (FavouritePoint fp : group.points) { - points.add(new LatLon(fp.getLatitude(), fp.getLongitude())); - names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName())); - } markersHelper.addMarkersSyncGroup(syncGroup); - markersHelper.addMapMarkers(points, names, syncGroup); + markersHelper.syncGroup(syncGroup); dismiss(); MapActivity.launchMapActivityMoveToTop(getActivity()); } diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index 3f19935655..481ba3154f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -411,14 +411,16 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment { new MarkersSyncGroup(favGr.name, favGr.name, MarkersSyncGroup.FAVORITES_TYPE, favGr.color); if (entry.getValue().size() == favGr.points.size()) { markersHelper.addMarkersSyncGroup(syncGr); + markersHelper.syncGroup(syncGr); + } else { + for (FavouritePoint fp : entry.getValue()) { + points.add(new LatLon(fp.getLatitude(), fp.getLongitude())); + names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName())); + } + markersHelper.addMapMarkers(points, names, syncGr); + points.clear(); + names.clear(); } - for (FavouritePoint fp : entry.getValue()) { - points.add(new LatLon(fp.getLatitude(), fp.getLongitude())); - names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName())); - } - markersHelper.addMapMarkers(points, names, syncGr); - points.clear(); - names.clear(); } MapActivity.launchMapActivityMoveToTop(getActivity()); } else {