The blocking issue happens also on real iPad II device, that is, the
CommandDialog not closing. But the button are pressed and the action is
executed as far as I understand by testing.
The issue is not happening on Android or CN simulator instead.
I would like to know if there are differences in threading such that the
CommandDialog mechanism does not work.
The CommandDialog has a background AlertDialog and it has another
AlertDialog upon the background one.
After one of the buttons is pressed the action is executed and both the
dialogs are closed.
There is a blocking instruction inside that is released.
But I would like to know if it is differently handled on iOS.
invokeAndBlock(runnable);
is the instruction, where
runnable=new Runnable() {
@Override
public void run() {
thread=Thread.currentThread();
try {
Thread.sleep(60*60*1000);
} catch (InterruptedException e) {
afterActions();
}
}
};
and
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
globalCommand = command;
System.out.println("button listener called");
thread.interrupt();
}
});
Furthermore, I do not know if it is relevant,
but I created a method
fakeShow()
that has to be called in the form's showListener,
creating and closing a fake CommandDialog, this somehow allowed the
subsequent CommandDialogs to work, maybe making some initial "cleaning".
(in the showListener of forms)
CommandDialog emptyDialogToBeOpenedForOtherDialogsToSpread=
new CommandDialog(currentForm);
emptyDialogToBeOpenedForOtherDialogsToSpread.fakeShow();
I cannot recall exactly, but it fixed similar issue on Android and CN
simulator, so I wonder if on iOS there is something similar but that the
workaround is not useful to fix.
Thanks
Regards
Il giorno giovedì 6 maggio 2021 alle 16:04:00 UTC+2 Steve Hannah ha scritto:
> Native components (e.g. Browser Component) are flaky in the Xcode
> simulator. If you make heavy use of them, you should debug on device and
> skip the Xcode simulator.
> (NOTE: for people finding this out of context, I'm just referring to the
> iOS Xcode simulator that ships with Apple's development tools - not to be
> confused with the Codename One simulator, on which native components such
> as BrowserComponent work find).
>
> On Thu, May 6, 2021 at 1:54 AM 'P5music' via CodenameOne Discussions <
> [email protected]> wrote:
>
>> (please also read the previous message)
>> I have to say that this is what I found at the end of the XCode
>> compilation (the app started and then closed but I did not see that, I was
>> not watching), but after some time I tried to run the app and it started
>> without error.
>> It just does not work as expected, but I do not think it is related to
>> the mentioned issue, because metrics are correct.
>> [The app just does not let the user to click buttons.
>> In the iOS simulator when I click a button in my special CommandDialog
>> instances, I see that the underlying BrowserComponents in the layout blink
>> black for a moment, but the button click has no effect.
>> It seems that the dialog is not closing, so I have to check that.]
>> Regards
>>
>> Il giorno giovedì 6 maggio 2021 alle 08:49:54 UTC+2 P5music ha scritto:
>>
>>>
>>> I am trying to execute my app on iOS simulator by means of the maven
>>> build system, I have a runtime issue now, for the
>>> getDisplayWidth
>>> function.
>>> This happens at the beginning of the app, where some metrics are
>>> calculated for the main form.
>>> Is this error due to my code or to the build or what else?
>>> I provide some file attachments, where you can find all necessary
>>> information from XCode.
>>> Thanks in advance
>>>
>> --
>> 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].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/codenameone-discussions/9becf1ea-6c5f-4c51-b64f-16b616f9786cn%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/codenameone-discussions/9becf1ea-6c5f-4c51-b64f-16b616f9786cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Steve Hannah
> Software Developer
> Codename One
> http://www.codenameone.com
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/3c8a1d35-f022-4078-90c6-b22b8d432b00n%40googlegroups.com.