-2

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.

vishnu
  • 213
  • 1
  • 13

1 Answers1

0
@Override
 public void onSensorChanged(SensorEvent event) {
 // TODO Auto-generated method stub
  if(event.sensor.getType()==Sensor.TYPE_PROXIMITY){

      //Toggle button here   
   }
}
Karan
  • 2,120
  • 15
  • 27