/**
* Configures the preferred units list preference.
*/
private void configUnitsListPreference() {
@SuppressWarnings("deprecation")
ListPreference listPreference = (ListPreference) findPreference(
getString(R.string.stats_units_key));
OnPreferenceChangeListener listener = new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference pref, Object newValue) {
boolean metricUnits = PreferencesUtils.STATS_UNITS_DEFAULT.equals((String) newValue);
configRateListPreference(metricUnits);
return true;
}
};
String value = PreferencesUtils.getString(
this, R.string.stats_units_key, PreferencesUtils.STATS_UNITS_DEFAULT);
String[] values = getResources().getStringArray(R.array.stats_units_values);
String[] options = getResources().getStringArray(R.array.stats_units_options);
configureListPreference(listPreference, options, options, values, value, listener);
}
StatsSettingsActivity.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:mytracks
作者:
评论列表
文章目录