×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    18

    Alert with Command

    I use Alert to display a message
    and then set a Command to it....
    it can run in J2ME simulator
    but can't in 3650.....always said illgslStateExcep....

    have any solution??

    Alert al = new Alert("testing");
    al.setTimeout(Alert.FOREVER);
    al.setType(AlertType.ERROR);
    Command cmd = new Command("abc",Command.SCREEN,1);
    al.addCommand(cmd);
    al.setCommandListener(this);
    display.setCurrent(al);

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Alerts do not support Commands and CommandListeners in MIDP-1.0. I suspect you are developing with the Wireless Toolkit 2.0 - this is the MIDP-2.0 toolkit, and contains new features that your phone will not support. Sun recomment WTK 1.0.4 for MIDP-1.0 development. CommandListeners are allowed on Alerts in MIDP-2.0.

    Graham.

Posting Permissions

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