2
votes

I built my forms using the GUI builder, but I am trying to implement the navigation buttons in code. I want the app to look similar in Android and Iphone, and am having a hard time trying to make the Back Buttons work.

So I ended up deciding to use the Toolbar (also because I need 1 Icon and 3 buttons on my Main form). Now, the app looks the same in both Android and IOS.

The problem is that when I add the Back Command to the Toolbar, the Android hardware button does not work. If I don't use the toolbar, the button works well, but the looks are different.

Could you check if this is an issue?

1

1 Answers

3
votes

I just tried this and it worked with the hardware buttons and all. I'll need a more accurate sample/test case of what's not working:

    final Form hi = new Form("First");
    Button test = new Button("Test");
    test.addActionListener((e) -> {
        Form newForm = new Form("Bye");
        newForm.setToolbar(new Toolbar());
        newForm.setBackCommand(new Command("Back") {
            @Override
            public void actionPerformed(ActionEvent evt) {
                hi.showBack();
            }
        });
        newForm.show();
    });
    hi.show();