In my application I want to detect the shake event and I'm using SensorEventListener, the code is working fine when my activity is running in foreground. But when I press the lock button of the phone to lock the screen, the shake event can't be detected. I have tested my code on the Samsung gts5360. But the same code is working fine on sony ericssion xperia mini pro. Actually my Samsung phone is not detecting the shake events when I leave the device idle for approx. 45 seconds, after locking the device.
Then I shake the phone, it does not detect the shake, but when I shake phone after several seconds delay it starts listening the shake. This behavior of my samsung phone is not consistent. It starts and stop listening the shake event after a random amount of time.
Now my question is that "Is this the android feature that the device does not detects a shake event when the screen is lock/Off ?".
If it is, then how my samsung phone starts/stops listening after some seconds of locking the phone?
And how it is continuously listening the shake event when screen is lock/off in "Sony ericssion xperia mini pro"?.
Is this feature vary vendor to vendor?
If some body needs my code then let me know,I will provide it.