java-medialoglwuitlwuit-resource-editorresource-editor

LWUIT Dialog problem with dispose()


I am making a dialog with a command. This command must close the dialog and go back to the previous form, but it is not working as expected. When I press the command, it closes the dialog but the form do not go back.

I am using the resource editor. State machine controls the app´s navigation.

The code inside the command´s logic is:

dialog.dispose();
StateMachine.back();

Is dispose() the method that I must use to close my dialog?

Thanks for reading.


Solution

  • As Nirmal said disposing the dialog goes to the previous form so while your call to "back()" works as expected your call to dispose() breaks that logic.

    You can override the postShow method for the form you are showing and detect the case of leaving the dialog (just turn on a flag when you need to go back) and call the back method when the form is shown in that condition.