Using Power Manager
<p>My app sets an alarm.   While waiting for the alarm my phone closes the screen.   When the alarm sounds the screen is dark so I press the power key and the screen lights up but I now have to touch the Lock button to access the app interface.   I would prefer that the Lock has been disposed off when the user responds to the alarm so I tried to use the power manager.  The alarm receiver starts a new activity so I initialised the power manager in the onCreate for this activity.    However this causes a force close error.  I call the power manager as follows      </p>

<pre><code>   PowerManager pm = (PowerManager)cText.getSystemService(Context.POWER_SERVICE);
   PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK , TAG);
   wl.acquire();
</code></pre>

<p>Any suggestions please.</p>
