executeOfflineCommand skips a command while executing from storage on Android

前端 未结 1 405
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 01:17

I have to execute \"Start\" and \"Finish\" Commands in the Sequential Order in my program and synchronize everything at the end. So I\'m inserting the Offline commands in th

相关标签:
1条回答
  • 2021-01-15 01:49

    Don't synchronize.

    That's nearly always a mistake in Codename One. Your code deals with the UI so it should be on the EDT and Display.getInstance().isEDT() should be true.

    My guess is that one of the commands in the middle uses one of the following invokeAndBlock() derivatives:

    • addToQueueAndWait
    • Modal dialogs

    Which triggers a second round of synchronization to run.

    You can trace that by reproducing the issue and checking which command in the list is specifically there at each time. Then fix that command so it doesn't block in this way.

    Another approach to fixing it is to remove the list immediately when you start processing which will prevent a duplicate execution of commands.

    0 讨论(0)
提交回复
热议问题