Fix crash #9462
This commit is contained in:
parent
7cdb927bde
commit
638a9c6231
3 changed files with 14 additions and 7 deletions
|
@ -206,7 +206,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
|
||||||
continue;
|
continue;
|
||||||
addTagView(tag.getKey(), tag.getValue());
|
addTagView(tag.getKey(), tag.getValue());
|
||||||
}
|
}
|
||||||
if (editPoiData.hasEmptyValue()) {
|
if (editPoiData.hasEmptyValue() && linearLayout.findViewById(R.id.valueEditText) != null) {
|
||||||
linearLayout.findViewById(R.id.valueEditText).requestFocus();
|
linearLayout.findViewById(R.id.valueEditText).requestFocus();
|
||||||
}
|
}
|
||||||
editPoiData.setIsInEdit(false);
|
editPoiData.setIsInEdit(false);
|
||||||
|
|
|
@ -214,13 +214,14 @@ public class EditPoiData {
|
||||||
}
|
}
|
||||||
retrieveType();
|
retrieveType();
|
||||||
PoiType pt = getPoiTypeDefined();
|
PoiType pt = getPoiTypeDefined();
|
||||||
if (pt != null) {
|
String editOsmTag = pt != null ? pt.getEditOsmTag() : null;
|
||||||
removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + pt.getEditOsmTag()));
|
if (editOsmTag != null) {
|
||||||
|
removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + editOsmTag));
|
||||||
currentPoiType = pt;
|
currentPoiType = pt;
|
||||||
String tagVal = pt.getEditOsmValue() != null ? pt.getEditOsmValue() : "";
|
String tagVal = pt.getEditOsmValue() != null ? pt.getEditOsmValue() : "";
|
||||||
tagValues.put(pt.getEditOsmTag(), tagVal);
|
tagValues.put(editOsmTag, tagVal);
|
||||||
if (userChanges) {
|
if (userChanges) {
|
||||||
changedTags.add(pt.getEditOsmTag());
|
changedTags.add(editOsmTag);
|
||||||
}
|
}
|
||||||
category = pt.getCategory();
|
category = pt.getCategory();
|
||||||
} else if (currentPoiType != null) {
|
} else if (currentPoiType != null) {
|
||||||
|
|
|
@ -765,8 +765,14 @@ public class ResourceManager {
|
||||||
toAddPoiTypes.put(poiCategory, new TreeMap<String, PoiType>());
|
toAddPoiTypes.put(poiCategory, new TreeMap<String, PoiType>());
|
||||||
}
|
}
|
||||||
Map<String, PoiType> poiTypes = toAddPoiTypes.get(poiCategory);
|
Map<String, PoiType> poiTypes = toAddPoiTypes.get(poiCategory);
|
||||||
for (String s : entry.getValue()) {
|
if (poiTypes != null) {
|
||||||
poiTypes.put(s, new PoiType(MapPoiTypes.getDefault(), poiCategory, null, s));
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue