社区
Eclipse
帖子详情
PowerManage.reboot(""); 为啥不行···
OnKeyDown灬Sona
2016-07-30 05:38:04
PowerManager pManager=(PowerManager) getSystemService(Context.POWER_SERVICE); //重启
pManager.reboot("");
为啥提示我 要创建 getSystemService 方法?
...全文
576
1
打赏
收藏
PowerManage.reboot(""); 为啥不行···
PowerManager pManager=(PowerManager) getSystemService(Context.POWER_SERVICE); //重启 pManager.reboot(""); 为啥提示我 要创建 getSystemService 方法?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
OnKeyDown灬Sona
2016-07-30
打赏
举报
回复
试了网上的 关机 try { //获得ServiceManager类 Class ServiceManager = Class .forName("android.os.ServiceManager"); //获得ServiceManager的getService方法 Method getService = ServiceManager.getMethod("getService", java.lang.String.class); //调用getService获取RemoteService Object oRemoteService = getService.invoke(null,Context.POWER_SERVICE); //获得IPowerManager.Stub类 Class cStub = Class .forName("android.os.IPowerManager$Stub"); //获得asInterface方法 Method asInterface = cStub.getMethod("asInterface", android.os.IBinder.class); //调用asInterface方法获取IPowerManager对象 Object oIPowerManager = asInterface.invoke(null, oRemoteService); //获得shutdown()方法 Method shutdown = oIPowerManager.getClass().getMethod("shutdown",boolean.class,boolean.class); //调用shutdown()方法 shutdown.invoke(oIPowerManager,false,true); } catch (Exception e) { UiUtils.logd(CASE_ID, "==============yao si le ================"); } 都可以,为啥自带的重启不可以
RemoteComputer
Manage
r.6.1.1.Full.rar
Wake on LAN over IPv6, lock workstation, log on, log off, sleep, hibernate, wake up,
reboot
,
power
off, lock and unlock input devices, registry merge, file copy, installation of MSI packages, clock ...
IBM HMC COMMANDLINE命令行 说明 MAN
IBM HMC(Hardware
Manage
ment Console)命令行工具是用于管理和监控IBM
Power
Systems服务器的重要工具,尤其在处理IBM AIX、IBM i(旧称iSeries或AS/400)、Linux等操作系统时不可或缺。此MAN(手册)文件应包含了...
Android系统关机和重启
当中,就有关于关机或重新启动的广播:Intent.ACTION_REQUEST_SHUTDOWN和Intent.ACTION_
REBOOT
,通过发送这两个广播。Android就能自己主动接收广播。并响应关机或重新启动的操作。ACTION_REQUEST和ACTION_
REBOOT
是...
android重新启动应用程序和重新启动系统
近日,由于项目需求,需要重新启动应用程序,所以就请教了我们公司的一班android大神。 重新启动应用程序,有两种方法,分别是: 1.通过Activity
Manage
r来重新启动应用程序: Activity
Manage
r
manage
r ...
manage
android permission权限
an application to
manage
(create, destroy, Z-order) application tokens in the window
manage
r. ) android.permission. MASTER_CLEAR 目前还没有明确的解释, Android 开发网分析可能是清除一切数据,...
Eclipse
58,441
社区成员
49,459
社区内容
发帖
与我相关
我的任务
Eclipse
Java Eclipse
复制链接
扫一扫
分享
社区描述
Java Eclipse
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章