Android SENSOR_PROXIMITY/SENSOR_LIGHT on Motorola Droid (Milestone)
<p>I'm trying to read the status of the Proximity sensor (also I tryed to read the Light sensor...) using the following code:</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) { 

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    txtStatus = (TextView)findViewById(R.id.txtStatus);
    sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
    sensorManager.registerListener(this, SensorManager.SENSOR_PROXIMITY);
}

@Override
protected void onStart() {
    super.onStart();
    sensorManager.registerListener(this, SensorManager.SENSOR_LIGHT);
}

@Override
public void onResume(){
    super.onResume();
    sensorManager.registerListener(this, SensorManager.SENSOR_LIGHT);
}

@Override
protected void onPause() {
  super.onPause();
  sensorManager.unregisterListener(this, SensorManager.SENSOR_LIGHT);
}
</code></pre>

<p>The txtStatus change the default text when there is a changing in the sensor (when I try to read the Accelerometer, it works...), but when I block the light sensor nothing happens.</p>

<p>When I'm in a call, the sensor works (when I put my hand blocking the sensor the screen turn off).</p>

<p>I'm missing something here?</p>

<p>Regards,
André</p>
