File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes how to check when Alert is gone? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how to check when Alert is gone?" Watch "how to check when Alert is gone?" New topic
Author

how to check when Alert is gone?

Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174


The result of this is false and in line 3 getCurrent() returns an instance of List instead of an instance of Alert.

How do I check if alert is disposed or not?
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
The specs say that setCurrent() returns immediately, and the change of screen may happen later, and also calling getCurrent immediately is unlikely to return the screen just set (as is in your case). (See the Javadoc for Display.setCurrent)
For you problem I think you have to add your own command and command listener to the Alert instance, and than you will know when the dismissal happens. For the standard option, with the implicit DISMISS_COMMAND and the implicit listener I don't think you can know that.
Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174

Strange.


This goes to an unending loop and console keeps writing not yet not yet not yet...
Thought?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

I'm confused here. As I recall it, when you display an Alert, it's a synchronous call. As soon as the method terminates, that is itself an indication that the Alert has been dismissed.

To that, you have the option of dispatching to a new form as part of the Alert method call, so that when the Alert ends, the new form takes over. Otherwise execution continues on the current form.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to check when Alert is gone?
 
Similar Threads
Current focused item in the form
my .jar didn't run well
Bluetooth Chat application
Getting root folder name in J2ME Midlet application
Display - Best practice