mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-24 17:45:50 +01:00
Settings: properly check the input type flag
Fixes a bug where latitude/longitude could be made empty
This commit is contained in:
parent
94cc1a883a
commit
903890067d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user