Sign in to follow this  

J2ME, handling the red END key.

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Normally, no. A few phones will allow you to ignore the red END button by passing in "true" to the "unconditional" parameter of destroyApp. If it does this, you can throw a MIDletStateChangeException to refuse to terminate. Most phones, however, don't give you the choice.

Share this post


Link to post
Share on other sites
Nokia Series 60 phones do not kill your app when you hit the END key, but instead put them into the background. But they apparently don't send pauseApp() either, because of Nokia's broken implementation :) But you *will* receive showNotify() and hideNotify() as appropriate.

And wouldn't that be a *false* 'unconditional' value which allows you to escape? (Note that this is being passed in by the phone, not from your code.)

And you can throw the exception anyway, the compiler can't do anything to stop you. The phone will presumably ignore it and quit anyway, though.

This is one of the many things I find silly about the whole MIDlet class design: I can't imagine why you'd *ever* check the 'unconditional' parameter, given that the caller is responsible for handling any exception anyway. Hell, they even made MSCE *checked*!

(Or does the preverifier maybe do something weird here? o_O)

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
And wouldn't that be a *false* 'unconditional' value which allows you to escape? (Note that this is being passed in by the phone, not from your code.)
Er, yeah. *smacks self*

Share this post


Link to post
Share on other sites

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this