diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java index e64ee3f029f..dccaaedff93 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java @@ -271,16 +271,14 @@ public boolean onPreferenceClick(Preference preference) { @Override public void onDisplayPreferenceDialog(Preference preference) { - final Optional preferenceDialog = - createPreferenceDialog( + this + .createPreferenceDialog( preference, this, - false); - if (preferenceDialog.isPresent()) { - show(preferenceDialog.get()); - } else { - super.onDisplayPreferenceDialog(preference); - } + false) + .ifPresentOrElse( + this::show, + () -> super.onDisplayPreferenceDialog(preference)); } private void show(final SearchablePreferenceDialog dialog) {