Solution apps for the apps that students create as they work through the Advanced Android Development training course created by Google Developer Training.
switch (sensorType) {
// Event came from the light sensor.
case Sensor.TYPE_LIGHT:
// Set the light sensor text view to the light sensor string
// from the resources, with the placeholder filled in.
mTextSensorLight.setText(getResources().getString(
R.string.label_light, currentValue));
break;
// Event came from the proximity sensor. <-- this comment is "missing"
case Sensor.TYPE_PROXIMITY:
// Set the proximity sensor text view to the light sensor <-- typo here, should be proximity instead of light
// string from the resources, with the placeholder filled in.
mTextSensorProximity.setText(getResources().getString(
R.string.label_proximity, currentValue));
break;
default:
// do nothing
}
In https://github.com/google-developer-training/android-advanced/blob/master/SensorListeners/app/src/main/java/com/example/android/sensorlisteners/MainActivity.java