I know that I'm doing something really stupid but can't see "the
forrest for the trees".
Have the following in preferences.xml
<ListPreference
android:key="dspmeasurement"
android:defaultValue="MILE"
android:title="@string/str_default_measurement"
android:entries="@array/measurementArray"
android:entryValues="@array/measurementValues" >
</ListPreference>
and in the program:
String prefdspmeasurement;
String strMeasure="initial";
prefdspmeasurement = dfltprefs.getString("dspmeasurement",
"ai");
if (prefdspmeasurement == "MILE")
strMeasure = "miles";
else
strMeasure = "kilometers";
Log.d("LPB: "," Measure:"+prefdspmeasurement+":"+strMeasure+"
Temperate:"+prefDspTemperate+" Dry:"+prefDspDry+" Urban:"+prefDspUrban
+" Mtn:"+prefDspMtn+" Flat:"+prefDspFlat);
The if seems to always return false. The debug statement below shows
the prefdspmeasurement to be MILE but the strMeasure is set to
kilometers.
03-17 21:28:00.380: DEBUG/LPB:(22849): Measure:MILE:kilometers
Temperate:true Dry:true Urban:true Mtn:true Flat:true
Any ideas would be appreciated.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en