1
可能重複:
Programmatically switching off Android phone關閉Android設備在特定時間
是否有可能寫關閉的應用程序(不重新啓動)的Android設備?例如,它播放一首歌曲,30分鐘後自動關閉設備。
可能重複:
Programmatically switching off Android phone關閉Android設備在特定時間
是否有可能寫關閉的應用程序(不重新啓動)的Android設備?例如,它播放一首歌曲,30分鐘後自動關閉設備。
這裏已經aswered .... Why does my app throw an `android.permission.REBOOT SecurityException`?
除非你有廠商密鑰簽署您的應用程序/或者如果你的設備是rooted..it是不可能的草皮其關閉。
http://stackoverflow.com/questions/2927083/how-to-realize-the-shutdown-using-code/ - 這是你需要的。 – Malcolm