Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User dukehoops's Avatar
    Join Date
    Apr 2004
    Posts
    6
    Hi,

    I am writing a Bluetooth-aware midlet, in which i'd like to use Alert to display inquiry messages. so initially, i'd like Alert to be displayed as modal (FOREVER), and then have bt-related code make it disappear once inquiry is done by doing

    setTimeout(1000) on already displayed Alert.

    entire sequence:

    alert.setTimeout(FOREVER);
    display.setCurrent(alert);
    //do some other stuff here
    //after a while call
    alert.setTimeout(1000);

    //alert should be dismissed in 1 sec?

    However, in my experience so far on Nokia 6600 and v0.31 s60 emulator, once the Alert is up, it stays up. Why is that and what can i do? Is it "legal" to change timeout value (and have it take effect) for an already displayed Alert? if not, how can i programmatically dismiss an Alert (other than by waiting for timeout to expire)?

    thanks
    -nikita

  2. #2
    Super Contributor shmoove's Avatar
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Instead of trying to change the timeout just set another Displayable as the current screen. If you want to wait for one second you can either run a thread that waits and then changes the displayable, or make another alert and use setCurrent(Alert a, Displayable next) (the second option is easier but the first is better I think).

    shmoove

  3. #3
    Registered User dukehoops's Avatar
    Join Date
    Apr 2004
    Posts
    6
    the first one is a good (and now obvious solution). setting another alert while an alert already exists may not work however, because i remember reading that if one tries to do that (display one alert while another's displayed) an exception will be thrown..

    -nikita

  4. #4
    Super Contributor shmoove's Avatar
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    if one tries to do that (display one alert while another's displayed) an exception will be thrown
    I haven't heard that. You can try.
    Even if it's true, since the first alert has it's timeout set to forever, you could just as well make it a Form.

    shmoove

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved