How to reboot the system by apk

1 In the AndroidManifest.xml to add the permission of below

Android.permission.DEVICE_POWER

Android.permission.REBOOT

2 in the apk java code to get the powermanager service and call it function to reboot

PowerManager powerManager =(Powermanager)getSystemService(“power”);

powerManager.reboot(null);

 

你可能感兴趣的:(service,powermanager,reboot)