Using proximity sensor lock and unlock a home screen
问题 I am doing one application using proximity sensor in android. when sensor changed it should lock the phone and when phone is locked using same sensor it should unlock a phone. To lock a phone am using double tap mechanisam. for lock using only a single tap. my code is like below: @Override public void onSensorChanged(SensorEvent event) { // TODO Auto-generated method stub if(event.sensor.getType()==Sensor.TYPE_PROXIMITY){ if(curTime2 - curTime1 < 1000) { Tap++; if(Tap==2 ) //&& (curTime2 -