×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Command Action problem in Asha

    Hi,


    I am developinn an application for "ASHA" series.In that i added some command to the inbuilt option(Appear at the left corner) of the screen.I tried to have action for that command,but if i select from the command list its not going into command action.

    Command AboutUS = new Command("about us", Command.SCREEN, 1);
    Command Help = new Command("help", Command.SCREEN, 1);
    Command logout = new Command("logout", Command.SCREEN, 1);
    Command exit = new Command("exit", Command.SCREEN, 1);

    canvas.addCommand(AboutUS);
    canvas.addCommand(Help);
    canvas.addCommand(logout);
    canvas.addCommand(exit);

    Tried to implement that:


    public void commandAction(Command c, Displayable d)
    {
    ------------------------------------------------------------------------->Its not coming into this command action.

    if(c == AboutUS)
    {
    System.out.println("about");
    }
    else if(c == Help)
    {
    System.out.println("help");
    }
    else if(c == logout)
    {
    System.out.println("logout");
    }
    else if(c == exit)
    {
    System.out.println("exit");
    }


    // throw new UnsupportedOperationException("Not supported yet.");
    }

    Please help me to solve this.Thanks in advance.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Command Action problem in Asha

    can i see your entire class make sure you class implements CommandListener !!

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

    Re: Command Action problem in Asha

    ... and
    Code:
    canvas.setCommandListener(this);  // or whatever object is the listener

  4. #4
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Command Action problem in Asha

    thanks grahamhughes..its working..

  5. #5
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Command Action problem in Asha

    yes i implement commandlistener..thanks for your reply..i solved this issue with the help of grahamhughes..

Similar Threads

  1. Replies: 14
    Last Post: 2012-12-06, 17:47
  2. Command Action for alert
    By vishal.vpb in forum Mobile Java General
    Replies: 12
    Last Post: 2011-08-22, 09:48
  3. Command Action with 2 Lists or more
    By NFC_Man in forum Mobile Java General
    Replies: 3
    Last Post: 2007-08-21, 07:01
  4. ChoiceGroup Command Action HELP
    By cjmarsha in forum Mobile Java General
    Replies: 2
    Last Post: 2005-07-29, 14:44
  5. Command Listener / Command action
    By monkforte in forum Mobile Java General
    Replies: 4
    Last Post: 2004-01-17, 14:42

Posting Permissions

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