• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to check when Alert is gone?

 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange.


This goes to an unending loop and console keeps writing not yet not yet not yet...
Thought?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic