i am developing an app that uses proximity sensor.i am doing this app as my project at college.so I would like to know how can I use the button turn off and on using the proximity sensor.thanks in advance.
@Override
public void onSensorChanged(SensorEvent event) {
// TODO Auto-generated method stub
if(event.sensor.getType()==Sensor.TYPE_PROXIMITY){
//Toggle button here
}
}