×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    22

    Exclamation Whats wrong with this simple code?

    Ive made a mobile app in java micro edition SDK, the program has a list with 2 items and select button on the bottom left side. When i go to any of the items in the list and press select nothing happens. Heres the code that should run when i press the select:

    if (c == turhaCommand) {
    int i = menu.getSelectedIndex ();

    if (i == 0) {
    menu.addCommand(piiloCommand);
    }
    }

    it should create a new button next to select when i go over a item in the list and press select but nothing happens

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

    Re: Whats wrong with this simple code?

    Is this code getting executed?

    Does c have the value you think it has?

    Graham.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    22

    Re: Whats wrong with this simple code?

    public void commandAction(Command c, Displayable s) {

    here goes the stuff i said before

    }

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

    Re: Whats wrong with this simple code?

    Can you answer the two questions I asked in my last post, please? If you give us more information, we have more chance of helping you.

    Graham.

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    22

    Re: Whats wrong with this simple code?

    I just noticed i forgot the setCommandListener, it works now.

Similar Threads

  1. Hi! Can u tell me whats wrong in this code? Thanks
    By qt_chenchen in forum Symbian
    Replies: 12
    Last Post: 2008-07-17, 06:17
  2. whats wrong with this code?
    By chishti.hameed in forum Symbian
    Replies: 3
    Last Post: 2005-05-19, 11:06
  3. Replies: 3
    Last Post: 2005-05-10, 07:56
  4. Whats wrong with this code?
    By jiasheng in forum Symbian
    Replies: 0
    Last Post: 2004-03-25, 19:20
  5. whats wrong with this code?
    By Rx-lee in forum Symbian
    Replies: 4
    Last Post: 2004-03-25, 10:50

Posting Permissions

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