diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java index c1f0dd42d7..5fbf6a084d 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java @@ -72,7 +72,11 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment { LatLon myLoc = l == null ? null : new LatLon(l.getLatitude(), l.getLongitude()); useCenter = !mapLinked; loc = (useCenter ? mw : myLoc); - heading = useCenter ? -mapRotation : head; + if (useCenter) { + heading = -mapRotation; + } else { + heading = head; + } } } nightMode = !app.getSettings().isLightContent(); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java index 594f8d7723..2c3018cd49 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java @@ -55,6 +55,9 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL @Override public void onItemClick(View view) { int pos = recyclerView.getChildAdapterPosition(view); + if (pos == RecyclerView.NO_POSITION) { + return; + } MapMarker marker = adapter.getItem(pos); mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(), 15, marker.getPointDescription(mapActivity), true, marker); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index 3013dabc8b..8368cb8091 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -184,6 +184,9 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel @Override public void onItemClick(View view) { int pos = recyclerView.getChildAdapterPosition(view); + if (pos == RecyclerView.NO_POSITION) { + return; + } Object item = adapter.getItem(pos); if (item instanceof MapMarker) { MapMarker marker = (MapMarker) item;