09-04-2008 03:09 PM
I was hoping to accomplish this by injecting the alt-shift-del key combination.
After some research I came to know that it is not possible to inject such combination.
Is there any other way to reset the device programatically?
09-04-2008 04:16 PM
Have you looked at
Device.requestPowerOff( true )
09-04-2008 04:44 PM
I can use that API as a last resort.
But I am really looking for a way to soft-reset the device.
Anybody?
09-04-2008 05:03 PM
I picked up the following code from someone on the Old forum, sorry don't remember who so can't give them credit.
Not sure why I have commented out the request to POWER_ON. I've not looked at the code in a year. So this code, as supplied, might not work. But I remember playing with it, and without much effort, I could get it to do a soft reset. However this is NOT enough to install applications, so didn't do what I wanted. But if all you want is a soft reset, then hopefully it will work for you.
public static final void powerCycle (int delayToPowerOn) { int timeDelay = 1000 * delayToPowerOn; ApplicationManager myMgr = ApplicationManager.getApplicationManager(); ApplicationDescriptor myDsc = ApplicationDescriptor.currentApplicationDescriptor
(); // myMgr.setCurrentPowerOnBehavior(myDsc.POWER_ON); Date myDate = new Date(); myMgr.scheduleApplication(myDsc, myDate.getTime()+timeDelay, true); net.rim.device.api.system.Device.requestPowerOff( true); }
09-04-2008 08:53 PM
Thanks very much for the code snippet. Going to be very useful if I have to go with power recycle option.
I am still looking for a way to accomplish the equivalant of what happens when you press alt-shft-del (ie soft reset)
10-02-2008 06:34 PM
^^ bump ^^
Is there a way to programmtically do the equivalant of pulling the battery? I am looking for the kind of reboot that happens after reinstalling some apps. Not the soft-reset (alt-caps-del).
Thanks in advance.
10-03-2008 10:07 AM
12-10-2008 02:14 PM
12-11-2008 01:25 AM
Check the following classes to emulate soft reset key sequence:
net.rim.device.api.system.EventInjector
net.rim.device.api.system.EventInjector.KeyEvent
12-12-2008 01:36 PM - edited 12-12-2008 01:36 PM