From 7b508da38d6096ab47aaf8e942cac9a3bd37b4bb Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 30 Sep 2015 20:54:28 +0300 Subject: [PATCH] EditPoiFragment. Fix for empty tags. --- OsmAnd/src/net/osmand/plus/osmedit/BasicDataFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/BasicDataFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/BasicDataFragment.java index 38553d550d..a14238a627 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/BasicDataFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/BasicDataFragment.java @@ -7,6 +7,7 @@ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.text.Editable; +import android.text.TextUtils; import android.text.TextWatcher; import android.util.TypedValue; import android.view.Display; @@ -162,7 +163,11 @@ public class BasicDataFragment extends Fragment @Override public void afterTextChanged(Editable s) { if (!getData().isInEdit()) { - getData().putTag(tag, s.toString()); + if (!TextUtils.isEmpty(s)) { + getData().putTag(tag, s.toString()); + } else { + getData().removeTag(tag); + } } }