In my android application I use PROXIMITY_SCREEN_OFF_WAKE_LOCK
WakeLock so that the screen is turned off when proximity sensor is activated.
The Android documentation says:
However, the device will not fall asleep while the screen has been turned off by the proximity sensor because it effectively counts as ongoing user activity.
But when the sensor is activated and the screen is off; the onPause
event of my activity is called, and onResume
is called again when the screen is on. Does it mean that the device go to sleep when the screen is off? any suggestion on how to prevent my activity from pausing when the screen is off?