Before marking this post as a \"duplicate\", I am writing this post because no other post holds the solution to the problem.
I am trying to turn off the device, then
Are you sure you requested the proper permission in your Manifest file?
You can use the AlarmManager1 class to fire off an intent that starts your activity and acquires the wake lock. This will turn on the screen and keep it on. Releasing the wakelock will allow the device to go to sleep on its own.
You can also take a look at using the PowerManager to set the device to sleep: http://developer.android.com/reference/android/os/PowerManager.html#goToSleep(long)