08-22-2008 12:19 PM - edited 08-22-2008 12:21 PM
When trying to self delete our application by using following code,the application is not removed if we do Device.requestPowerOff(false) but the application is removed if we do CodeModuleManager.promptForResetIfRequired(). So PowerOff != Reset?
So my question is, is there a way to do a programtic reset that will remove our application? Or am I doing something wrong to do a self delete in our application?
This is happening on
Thanks for your time.
ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor
int moduleHandle = ad.getModuleHandle();
int rc = CodeModuleManager.deleteModuleEx(moduleHandle, true);
//Device.requestPowerOff( false );
Solved! Go to Solution.
08-25-2008 09:51 AM
You are correct, power off is not the same as reset. Power off suspends running applications and puts the BlackBerry in a "sleep" mode. When it is powered on applications resume from where they left off. This is the same as powering on/off a BlackBerry using the power button or red end key (varies based on model). The BlackBerry can power on almost instantly from this state.
A reset more closely resembles removing and reinserting the battery. This stops all applications and the JVM. When the BlackBerry restarts, the JVM restarts along with any auto-start applications. This process takes a few minutes.
If promptForResetIfRequired yields true, then it means the BlackBerry is unable cod files until the BlackBerry is restarted. The link below lists reasons why this may occur.
What Is - The reason a reset is required when upgrading an application
Article Number: DB-00602