Using proximity sensor in android
问题 I want to use proximity sensor in my project. I searched for proximity sensor tutorial. And I found a sensor tutorial at http://www.vogella.com/articles/AndroidSensor/article.html#sensoroverview_manager. I tried to use proximity sensor as following code: @Override public void onSensorChanged(SensorEvent event) { if(event.sensor.getType() == Sensor.TYPE_PROXIMITY) { Toast.makeText(getApplicationContext(), "working", Toast.LENGTH_SHORT).show(); } } My Activity is implementing