From 903890067d9e64db0a82b3104c8560eebabc6c01 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 5 Jul 2016 23:14:48 +0200 Subject: [PATCH] Settings: properly check the input type flag Fixes a bug where latitude/longitude could be made empty --- .../gadgetbridge/activities/AbstractSettingsActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractSettingsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractSettingsActivity.java index 965a0cfd6..8f0085674 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractSettingsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractSettingsActivity.java @@ -44,7 +44,7 @@ public abstract class AbstractSettingsActivity extends PreferenceActivity { @Override public boolean onPreferenceChange(Preference preference, Object value) { if (preference instanceof EditTextPreference) { - if (((EditTextPreference) preference).getEditText().getKeyListener().getInputType() == InputType.TYPE_CLASS_NUMBER) { + if ((((EditTextPreference) preference).getEditText().getKeyListener().getInputType() & InputType.TYPE_CLASS_NUMBER) != 0) { if ("".equals(String.valueOf(value))) { // reject empty numeric input return false;