• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need little help on Alert

 
Pete Larocque
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a little problem, I'm developping on Blackberry, but using J2ME API not RIM ones.

I want to display a succes alert, then exit my midlet, but every time I have code following my display Alert, the alert screen don't show up, it simply goes directly to the following code.



I tried a couple of things, maybe the functions returning a value, then call the exit in the other functions, tried a thread.sleep before the exitMIDlet() call, still no go.

Thank you!
[ May 29, 2006: Message edited by: Pete Larocque ]
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem may be that you're exiting the MIDlet before the system has even time to display the alert.
Display.setCurrent() sets the display assynchronously.

You must use a CommandListener with the Alert
and handle the Alert.DISMISS_COMMAND within the listener
to execute exitMidlet(), as shown in the following code fragment.



Check the MIDP Javadoc for more details.
[ May 31, 2006: Message edited by: Eduardo Marques ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic