diff --git a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java index 9d343a04c2..64451a19d7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java @@ -206,7 +206,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment continue; addTagView(tag.getKey(), tag.getValue()); } - if (editPoiData.hasEmptyValue()) { + if (editPoiData.hasEmptyValue() && linearLayout.findViewById(R.id.valueEditText) != null) { linearLayout.findViewById(R.id.valueEditText).requestFocus(); } editPoiData.setIsInEdit(false); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java index 27a25bfc1c..b11c828436 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java @@ -214,13 +214,14 @@ public class EditPoiData { } retrieveType(); PoiType pt = getPoiTypeDefined(); - if (pt != null) { - removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + pt.getEditOsmTag())); + String editOsmTag = pt != null ? pt.getEditOsmTag() : null; + if (editOsmTag != null) { + removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + editOsmTag)); currentPoiType = pt; String tagVal = pt.getEditOsmValue() != null ? pt.getEditOsmValue() : ""; - tagValues.put(pt.getEditOsmTag(), tagVal); + tagValues.put(editOsmTag, tagVal); if (userChanges) { - changedTags.add(pt.getEditOsmTag()); + changedTags.add(editOsmTag); } category = pt.getCategory(); } else if (currentPoiType != null) { diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 220bfe767a..ae123b2c8b 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -765,8 +765,14 @@ public class ResourceManager { toAddPoiTypes.put(poiCategory, new TreeMap()); } Map poiTypes = toAddPoiTypes.get(poiCategory); - for (String s : entry.getValue()) { - poiTypes.put(s, new PoiType(MapPoiTypes.getDefault(), poiCategory, null, s)); + if (poiTypes != null) { + for (String s : entry.getValue()) { + PoiType pt = new PoiType(MapPoiTypes.getDefault(), poiCategory, null, s); + pt.setOsmTag(""); + pt.setOsmValue(""); + pt.setNotEditableOsm(true); + poiTypes.put(s, pt); + } } } }