private void storeSpeedValue(int keyId,int minValue,int maxValue,int defaultValue,String displayValue){
  int value;
  try {
    value=Integer.parseInt(displayValue);
  }
 catch (  NumberFormatException e) {
    Log.e(TAG,"invalid value " + displayValue);
    value=defaultValue;
  }
  if (value > maxValue) {
    value=maxValue;
  }
  if (value < minValue) {
    value=minValue;
  }
  PreferencesUtils.setInt(this,keyId,value);
}

private void storeSpeedValue ( int keyId , int minValue , int maxValue , int defaultValue , String displayValue ) { int value ; try { value = Integer . parseInt ( displayValue ) ; } catch ( NumberFormatException e ) { Log . e ( TAG , "invalid value " + displayValue ) ; value = defaultValue ; } if ( value > maxValue ) { value = maxValue ; } if ( value < minValue ) { value = minValue ; } PreferencesUtils . setInt ( this , keyId , value ) ; }
stores a speed value , always in metric units .
