2010-12-03 98 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()。這將導致設備復位(重新啓動)

相關問題