I have tried your suggestion with no success. I attempted 2 different
variations before coming back to this support forum. In the first variation
I included the "showForm("register", null);" line inside the "call serially
wrapper" and the code froze at the same spot. I waited for approximately 5
minutes just to be sure it wasn't just a slow loading app.
For the second variation (the code segment included below), I moved the "
showForm("register", null);" line outside the "call serially wrapper". This
time the code froze on the same line of code, but in a different sequence.
This time the "beforeRegister(Form f)" function was called and completed
before the serial wrapper executed and froze on the "Dialog.show("Device
Registration", "We will need to perform registration before you can make
use of this application.", "OK", null);" line.
I've also included the beforeRegister() function so you can see there is no
blocking calls made there. The only errors I get are the handled "Try/Catch
wrapped" JavaIO errors I mentioned before.
System.out.println("setting status message text...");
statusMsg.setText("Opening Registration System...");
Display.getInstance().callSerially(() -> {
System.out.println("Showing registration needed dialog serially...");
Dialog.show("Device Registration", "We will need to perform registration
before you can make use of this application.", "OK", null);
});
System.out.println("Opening Registration System...");
showForm("register", null);
@Override
protected void beforeRegister(Form f) {
System.out.println("preparing to show register form...");
registerForm = f;
TextArea header = (TextArea)findByName("HeaderText", registerForm);
header.setText("Evans allows a single user to be responsible for multiple
devices. You give each device a 'Device Alias' (Please note special characters
and spaces are not allowed) that identifies it in your account audit
trail.\n\nIf you are already a member you only need to complete your email
address, password and device alias to have this device added to your
account.\n\nNew users should please complete all the fields in the form
below.");
System.out.println("Register form ready to display...");
}
On Wednesday, July 6, 2016 at 6:40:20 AM UTC+1, Shai Almog wrote:
>
> Dialog is a blocking method so if you show it during initialization you
> are blocking the rest of the initialization. Wrap the call in a
> callSerially(...) which will postpone it to the next event dispatch thread
> loop.
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/33d46846-66ad-4bc8-965f-1af41383e88d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.