lwuit
  1. lwuit
  2. LWUIT-501

GameCanvasImplementation: Can not assign device Back button to a LWUIT Form

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      LWUIT 1.5

      Description

      We want to create a LWUIT Form which can listen to device Back key. But looks GameCanvasImplementation setCommands(Vector v) can not work correctly due to wrong logic.

      In this Form constructor, we add:
      TestForm() {
      super ("Back test form")
      ...
      Display.getInstance().setNativeCommands (true) ;
      setBackCommand (backCommand) ;
      addCommand (backCommand) ;
      addCommandListener (this) ;
      ...
      }

      -----------------------------------
      GameCanvasImplementation setCommands(Vector v) {
      ...
      if(Display.getInstance().getCurrent() != null) { // when this method is called, the TestForm we created has not been set to current
      backCommand = Display.getInstance().getCurrent().getBackCommand(); // so, this may return NULL, not the backCommand we set in TestForm backCommand
      } // so the below lcdui Command.BACK will not be created and add to lcudi Canvas !

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            yangj3848
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: