To demo this sample do the following
1. Leave the toggle button off and tap the start button
2. Turn toggle on to activate the powerManager and tap the start button
After both instances press the power button to turn the screen off
Results
1. Beacuse the device goes to sleep after the screen got off the alarm doesn't ring
2. Even though the screen is off the device won't sleep until the alarm sounds.
Power Manager