I am creating app(only for Android 6) in which I have to give reboot functionality using button click. I am using following code:
PowerManager pm =(PowerMan
if you running Android M (API 23) you have to set runtime permission for reboot.
If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running. The user can grant or deny each permission, and the app can continue to run with limited capabilities even if the user denies a permission request.
Requesting Permissions at Run Time