2010-12-03 63 views

回答

2

看看Device类中使用requestPowerOff()方法。

编辑:好的,这里有一些示例代码。要让设备再次打开,您必须安排其他应用程序在将来的某个时间点运行。你可能会想编写一个应用程序,该应用程序不会向用户显示任何内容并安排它。但是,我偶然为我录制了录像机的模块名称,因此我将其备份。

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

感谢您的回复,但我是新来的BB,所以你能不能给我的示例代码演示? – Piyush 2010-12-03 13:31:37

+0

这会关闭设备电源,但它不会与重置/重启相同。关闭电源时,内存完好无损,设备实际处于休眠状态。 – seand 2010-12-05 05:31:43

-1

Device.requestStorageMode()。这将导致设备复位(重新启动)

相关问题