fix crash

This commit is contained in:
vshcherb 2014-05-21 11:24:46 +02:00
parent 81daec3e70
commit 8991595423
2 changed files with 7 additions and 2 deletions

View file

@ -9,6 +9,10 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="tip_recent_changes_1_8_alpha">Changes in 1.8:
* Calculate route between route points of GPX track
* Changed layout of countries for downloads (support local names search)
</string>
<string name="use_points_as_intermediates">Calculate route between points</string>
<string name="osmo_register_device">Registering device... </string>
<string name="osmo_io_error">OSMo connection problem : </string>

View file

@ -632,7 +632,8 @@ public class OsmandSettings {
public final OsmandPreference<DrivingRegion> DRIVING_REGION = new EnumIntPreference<DrivingRegion>(
"default_driving_region", DrivingRegion.EUROPE_ASIA, DrivingRegion.values()) {
protected boolean setValue(Object prefs, DrivingRegion val) {
((CommonPreference<MetricsConstants>)METRIC_SYSTEM).cachedValue = null;
//((CommonPreference<MetricsConstants>)METRIC_SYSTEM).cachedValue = null;
((CommonPreference<MetricsConstants>)METRIC_SYSTEM).set(DRIVING_REGION.get().defMetrics);
return super.setValue(prefs, val);
};
}.makeGlobal().cache();
@ -640,7 +641,7 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
// cache of metrics constants as they are used very often
public final OsmandPreference<MetricsConstants> METRIC_SYSTEM = new EnumIntPreference<MetricsConstants>(
"default_metric_system_2", MetricsConstants.KILOMETERS_AND_METERS, MetricsConstants.values()){
"default_metric_system", MetricsConstants.KILOMETERS_AND_METERS, MetricsConstants.values()){
protected MetricsConstants getDefaultValue() {
return DRIVING_REGION.get().defMetrics;
};