Android - Execute action when phone is locked
<p>I want to know how I can execute some action, or continue listening to sensor or battery change events when the phone is locked. (When the phone is locked it stops listening to sensor changes.)</p>

<p>I've tried with wakelocks but I it doesn't work (maybe I'm using it wrong).</p>

<p>Any help would be appreciated.</p>
