mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 01:21:56 +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
f9f3c32a2f
commit
4b95974cec
@ -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