diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index e0bcefd818..7bb5a2371c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -296,6 +296,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm str = str.substring(0, str.length() - 1); focusedEditText.setText(str); focusedEditText.setSelection(str.length()); + } else { + switchToPreviousInput(focusedEditText.getId()); } break; case SWITCH_TO_NEXT_INPUT_BUTTON_POSITION: @@ -657,6 +659,14 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm } } + private void switchToPreviousInput(int id) { + if (id == R.id.name_edit_text) { + ((OsmandTextFieldBoxes) mainView.findViewById(R.id.longitude_box)).select(); + } else if (id == R.id.longitude_edit_text) { + ((OsmandTextFieldBoxes) mainView.findViewById(R.id.latitude_box)).select(); + } + } + private void addMapMarker() { final String latitude = ((EditText) mainView.findViewById(R.id.latitude_edit_text)).getText().toString(); final String longitude = ((EditText) mainView.findViewById(R.id.longitude_edit_text)).getText().toString();