0

I have two LWUIT commands on my LWUIT Form : "back" and "Phone". When I click on the "Phone" command then a LWUIT Dialog is shown , this Dialog contains a List of commands :

if (ae.getCommand() == back)
{
    backForm.showBack();
}
else if (ae.getCommand() == phoneCmd)
{
    Command[] comms = new Command[6];
    comms[0] = agrandir;
    comms[1] = transferer;
    comms[2] = telecharger;
    comms[3] = camera;
    comms[4] = delete;
    comms[5] = annuler;
    isMenuShown = true;
    new CMenu(comms, "droite").affiche();
}

The CMenu class is a LWUIT Dialog which contains a List of Commands , the commands are passed to the array of commands "comms".

I want a specific command , the "delete" command, of the CMenu Dialog to be executed in my code. How to achieve that ?

1 Answers1

1

Easiest way is to use myList.setCommandList(true).

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • I already set setCommandList to true in the constructor of the CMenu Dialog. So how to make a certain command be executed programmatically ? –  Sep 05 '11 at 06:06
  • What specifically isn't working? The action performed methods of the commands should be executed just fine and adding a command listener to the dialog should send the proper events. Its possible you are tracking commands only on the parent form and not on the CMenu dialog – Shai Almog Sep 05 '11 at 07:45
  • Perhaps I did not say my problem very clearly : I do not touch any button , nor the screen when the phone mobile is a tactile device. I want the command to be executed during my program code. So how to make that possible ? –  Sep 05 '11 at 08:00
  • 1
    Just get the command and invoke Form's dispatchCommand() method. – Shai Almog Sep 08 '11 at 04:35