I am trying to switch off android device through my program. It actually gets switched off but it restarts itself. I want the phone not to restart again by itself. How can I
I suppose you have found the answer,but this might help other users.
It's not possible to turn off your device. Here is an easy way to lock it :
You won't need any permissions, because some are only granted for system apps(like DEVICE_POWER and REBOOT). You also won't need to root your device.