Prevent errors in case numeric settings are empty
Even though some of the settings like pollDistance and pollInterval are set to be numeric and (at least as I tested) cannot be negative or contain anything else than numbers, they can be an empty string. Parsing that empty string to parseInt() is causing trouble.
This patch looks for empty strings and in that case uses the default value instead. In addition, it resets the preference value to that default to make the usage of that default clear to the user.
This should close #1100.
Note that this only happens here when those values are used: when an activity starts. Ideally, this should be prevented by Android itself, but barring that, it should be checked right after the setting is changed in the settings dialog. However, this is beyond my current Android-Voodoo.
Also note, that this code (like the original version) duplicates the default values from the file settings.xml. Ideally, that default should be obtained and used instead - alas I do not know how that can be done.
Seem OK, will go into details later
default values from the file settings.xml. Ideally, that default should be obtained and used instead - alas I do not know how that can be done.
Agree