How to reboot the system by apk

来源:互联网 发布:ipaf看书软件 编辑:程序博客网 时间:2024/06/05 01:54

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);

 

0 0
原创粉丝点击