Is there an API that will allow you to reboot the blackberry device?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Look at using the requestPowerOff() method in the Device class.
Edit: Ok, here's some sample code. To get the device to turn on again you have to schedule another application to run at some point in the future. You'll probably want to write an application that doesn't show anything to the user and schedule that. However, I happened to have the module name for the video recorder on me so I bring that back up.
Device.requestPowerOff(true);
int handle = CodeModuleManager.getModuleHandle("net_rim_bb_videorecorder");
ApplicationDescriptor desc =
CodeModuleManager.getApplicationDescriptors(handle)[0];
//Schedules the video recorder to come up two seconds after the current time.
ApplicationManager.getApplicationManager().scheduleApplication(desc,
System.currentTimeMillis() + 2000, true);
回答2:
Please try this code
http://aliirawan-wen.blogspot.com/2011/10/reset-programmatically-in-blackberry.html
回答3:
Device.requestStorageMode(). This will induce the device to reset (reboot)