mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +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
|
@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;
|
||||||
|
Loading…
Reference in New Issue
Block a user