2
votes

I have an Android application that uses the sidemenu. When I add a material command to the side menu, the command does not execute the code associated to it.

In the simulator, I have to press the material command several times before it reacts properly. On the installed device, the material command dos not work at all.

Command seems to work and adding a button to the sidemenu works normally.

Here is my code:

    toolbar.addMaterialCommandToSideMenu("Home", FontImage.MATERIAL_HOME, e -> {

        System.out.println("home");
        form.removeAll();
        toolbar.removeAll();
        hi.start();


    }); 
1
Is your purpose to restart the app? What log do you have on the simulator and on the real device? - Francesco Galgani
Yes, the idea is to restart the app. But even print statements seem not to work properly. And there are no error messages. - rainer
Try to replace all the code inside the Java lambda with Log.p("Command invoked"); and then check the Edt log again. - Francesco Galgani

1 Answers

2
votes

We had a regression because one of the changes mentioned here: https://www.codenameone.com/blog/ios-back-command-behavior.html

Please try updating using Codename One Settings. If it doesn't bring a new version delete the file UpdateStatus.properties from the .codenameone directory in your home directory.