codenameone form.show() reverts to current form

Viewed 72

I have an application that calls a login form, using .show(), which then connects to a server. If the credentials are correct and the server returns a valid connection response, I want to show another form with a list on it. The code that calls the new form is;

            if(h.get("result").toString().trim().equals("Valid")) {
                System.out.println("need to show establishments form");
                Establishments establishments = new Establishments();
                establishments.setFocus(true);
                establishments.show();
            }

When the new form, which was build with the GUI Builder, displays, it is only for and instant and the simulator reverts back to the login form. I put in some System.out.println and sleep commands and see that control was given to the new form. When the timer(s) end, the new form shows, but is immediately replaced by the login form. Any ideas on what I am doing wrong?

0 Answers
Related