Settings: properly check the input type flag

Fixes a bug where latitude/longitude could be made empty
master
Andreas Shimokawa 2016-07-05 23:14:48 +02:00
parent 94cc1a883a
commit 903890067d
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ public abstract class AbstractSettingsActivity extends PreferenceActivity {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object value) { public boolean onPreferenceChange(Preference preference, Object value) {
if (preference instanceof EditTextPreference) { 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))) { if ("".equals(String.valueOf(value))) {
// reject empty numeric input // reject empty numeric input
return false; return false;