×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    18

    Display.setCurrent and Display.getCurrent

    Hi all,

    I am experiencing a problem with Display.setCurrent and Display.getCurrent. I understand that a call to getCurrent will not always return the latest display.

    Is there a way to wait until it has?

    display.setCurrent(nextDisplayable);
    while (display.getCurrent() != nextDisplayable)
    ;

    I have tried the above, but it never breaks out of the loop.

    Many thanks,
    Lea Hayes

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Display.setCurrent and Display.getCurrent

    If you do this in an event handler, you block the event system from making the new Displayable current, hence is locks (the condition can never be met).

    You need to wait for an event (like paint() or showNotify()).

    Graham.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    18

    Re: Display.setCurrent and Display.getCurrent

    Thanks again Graham, that worked like a charm.

    Lea Hayes

Similar Threads

  1. Please help: Display.setCurrent() delay
    By dschuller in forum Mobile Java General
    Replies: 5
    Last Post: 2008-04-17, 06:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×