Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Issue #109 changed instaceof String string to newValue
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatjc committed Oct 13, 2023
1 parent 84ec8c3 commit 37ab38d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public void onDisplayPreferenceDialog(Preference preference) {
private void setWheelCircumferenceInputFilter() {
EditTextPreference wheelPreference = findPreference(getString(R.string.settings_sensor_bluetooth_cycling_speed_wheel_circumference_key));
wheelPreference.setOnPreferenceChangeListener((preference, newValue) -> {
if (newValue instanceof String) {
if (newValue instanceof String string) {
try {
int newValueInt = Integer.parseInt((String) newValue);
int newValueInt = Integer.parseInt(string);
return newValueInt >= 100 && newValueInt < 4000;
} catch (NumberFormatException e) {
Log.w(TAG, "Entered string is no number.");
Expand Down

0 comments on commit 37ab38d

Please sign in to comment.