forked from upstream-mirrors/OpenTracks
Check for null preferences before trying to use them
This commit is contained in:
@@ -232,10 +232,14 @@ public class MyTracksSettings extends PreferenceActivity {
|
|||||||
|
|
||||||
// Update the ANT+ sensors.
|
// Update the ANT+ sensors.
|
||||||
// TODO: Only enable on phones that have ANT+.
|
// TODO: Only enable on phones that have ANT+.
|
||||||
findPreference(getString(R.string.ant_heart_rate_sensor_id_key))
|
Preference antHrm = findPreference(getString(R.string.ant_heart_rate_sensor_id_key));
|
||||||
.setEnabled(getString(R.string.ant_sensor_type).equals(sensorType));
|
Preference antSrm = findPreference(getString(R.string.ant_srm_bridge_sensor_id_key));
|
||||||
findPreference(getString(R.string.ant_srm_bridge_sensor_id_key))
|
if (antHrm != null && antSrm != null) {
|
||||||
.setEnabled(getString(R.string.srm_ant_bridge_sensor_type).equals(sensorType));
|
antHrm
|
||||||
|
.setEnabled(getString(R.string.ant_sensor_type).equals(sensorType));
|
||||||
|
antSrm
|
||||||
|
.setEnabled(getString(R.string.srm_ant_bridge_sensor_type).equals(sensorType));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user