diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 43fe81569e..866a9c442e 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ Wrong input
Enter new name
Back
Wrong format
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java
index 77bd395cdb..886c38794e 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java
@@ -71,14 +71,18 @@ public class RenameMarkerBottomSheetDialogFragment extends BottomSheetDialogFrag
@Override
public void onClick(View view) {
String name = nameEditText.getText().toString();
- marker.setName(name);
- mapActivity.getMyApplication().getMapMarkersHelper().updateMapMarker(marker, true);
- FragmentManager fm = mapActivity.getSupportFragmentManager();
- Fragment fragment = fm.findFragmentByTag(MarkerMenuOnMapFragment.TAG);
- if (fragment != null) {
- ((MarkerMenuOnMapFragment) fragment).dismiss();
+ if (name.replaceAll("\\s", "").length() > 0) {
+ marker.setName(name);
+ mapActivity.getMyApplication().getMapMarkersHelper().updateMapMarker(marker, true);
+ FragmentManager fm = mapActivity.getSupportFragmentManager();
+ Fragment fragment = fm.findFragmentByTag(MarkerMenuOnMapFragment.TAG);
+ if (fragment != null) {
+ ((MarkerMenuOnMapFragment) fragment).dismiss();
+ }
+ dismiss();
+ } else {
+ nameEditText.setError(getString(R.string.wrong_input));
}
- dismiss();
}
});