diff --git a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java index f745f0f084..746daa6f8f 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java @@ -46,6 +46,8 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment private EditText webSiteEditText; private EditText descriptionEditText; OpeningHoursAdapter mOpeningHoursAdapter; + + private boolean basicTagsInitialized = false; @Nullable @Override @@ -130,7 +132,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment if (data != null && !data.isInEdit()) { if (!TextUtils.isEmpty(s)) { data.putTag(tag, s.toString()); - } else { + } else if (basicTagsInitialized && isResumed()) { data.removeTag(tag); } } @@ -178,6 +180,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment } mOpeningHoursAdapter.replaceOpeningHours(openingHours); mOpeningHoursAdapter.updateViews(); + basicTagsInitialized = true; } private class OpeningHoursAdapter { @@ -223,7 +226,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment data.putTag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(), openingHoursString); } - } else { + } else if (basicTagsInitialized && isResumed()) { data.removeTag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue()); } }