Skip to main content

application not exiting

5 replies [Last post]
alya
Offline
Joined: 2010-04-08

hello
I have this application that needs to send an SMS to some Address the senario is as follows the user gets prompted with the confirmation message that comes with Connector.open("sms://" + smsAddress);
if the user presses no to the confirmation a security Exception gets caught and the application should exit
in the SecurityException caught i did the following

catch (SecurityException e) {
destroyApp(true);
notifyDestroyed();
}

and i debugged my code and made sure that the exception is getting caught and the destroyApp &notifyDestroyed are being reached but the midlet is not exiting
does anyone have any clue whats the reason
PS: the destroyApp(true) doesnt include anything its empty is this how it should be??

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

This is something we do quite frequently and it works for me.
You don't need to call destroyApp(true) and you probably should have a return statement immediately after notifyDestroyed() since there should be no further execution from this point on.

alya
Offline
Joined: 2010-04-08

hello vprise thanks for ur reply but i tried what u proposed, it didnt work i didnt call destroyApp(true);
i used the following:

notifyDestroyed();
return;

but still it didnt work is there any reason for that to happen maby some other runnning thread plz any suggestions am out of solutions i need the application to exit.
PS: my application includes an exit command in many forms and it operates perfectly when SoftButton is pressed..

alya
Offline
Joined: 2010-04-08

ok it worked after i used an outside flag that i set to true if any Security Exception occurs andi also used the return inside my SendSMS() caught SE.
and after calling the
SendSMS()
i check the flag and exitaccordingly
if (exitflag == true) {
destroyApp(true);
notifyDestroyed();
return;
}
thanks for your help

tbokka
Offline
Joined: 2010-06-24

Hi,

How did you debug your code? On emulator?

I'm assuming that you're trying this code on a device. Is the execution reaching that code on the device? Are you sure the device is raising the same exception?

Regards,
-Tiru

alya
Offline
Joined: 2010-04-08

I debugged it on Sun's emulator but i also tried it on a nokia Xpress music phone and made sure its reaching the caught SE it is not exiting its continuing to run on both emulator and phone.