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;
|
||||
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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -765,8 +765,14 @@ public class ResourceManager {
|
|||
toAddPoiTypes.put(poiCategory, new TreeMap<String, PoiType>());
|
||||
}
|
||||
Map<String, PoiType> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue