Fix update query; fix opening of old markers

This commit is contained in:
Alex 2017-10-17 13:09:03 +03:00 committed by Alexey Kulish
parent 529de80676
commit a6a7a98184
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,6 @@ import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.TargetPointsHelper.TargetPointChangedListener; import net.osmand.plus.TargetPointsHelper.TargetPointChangedListener;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.DashboardOnMap;
import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.mapcontextmenu.MenuController.ContextMenuToolbarController; import net.osmand.plus.mapcontextmenu.MenuController.ContextMenuToolbarController;
import net.osmand.plus.mapcontextmenu.MenuController.MenuState; import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
@ -44,6 +43,7 @@ import net.osmand.plus.mapcontextmenu.editors.RtePtEditor;
import net.osmand.plus.mapcontextmenu.editors.WptPtEditor; import net.osmand.plus.mapcontextmenu.editors.WptPtEditor;
import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu; import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu;
import net.osmand.plus.mapcontextmenu.other.ShareMenu; import net.osmand.plus.mapcontextmenu.other.ShareMenu;
import net.osmand.plus.mapmarkers.MapMarkersDialogFragment;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.ContextMenuLayer; import net.osmand.plus.views.ContextMenuLayer;
@ -717,7 +717,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
if (pointDescription.isMapMarker()) { if (pointDescription.isMapMarker()) {
hide(); hide();
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.MAP_MARKERS); MapMarkersDialogFragment.showInstance(mapActivity);
} else { } else {
mapActivity.getMapActions().addMapMarker(latLon.getLatitude(), latLon.getLongitude(), mapActivity.getMapActions().addMapMarker(latLon.getLatitude(), latLon.getLongitude(),
getPointDescriptionForMarker()); getPointDescriptionForMarker());

View file

@ -140,7 +140,7 @@ public class MapMarkersDbHelper {
if (oldVersion < 10) { if (oldVersion < 10) {
db.execSQL("ALTER TABLE " + MARKERS_TABLE_NAME + " ADD " + MARKERS_COL_SELECTED + " int"); db.execSQL("ALTER TABLE " + MARKERS_TABLE_NAME + " ADD " + MARKERS_COL_SELECTED + " int");
db.execSQL("UPDATE " + MARKERS_TABLE_NAME + db.execSQL("UPDATE " + MARKERS_TABLE_NAME +
" SET" + MARKERS_COL_SELECTED + " = ? " + " SET " + MARKERS_COL_SELECTED + " = ? " +
"WHERE " + MARKERS_COL_SELECTED + " IS NULL", new Object[]{0}); "WHERE " + MARKERS_COL_SELECTED + " IS NULL", new Object[]{0});
} }
} }