Modal Dialog does not appear

蓝咒 提交于 2021-02-08 08:27:51

问题


In my App I have an annoying behavior. It is causing problems to my costumers.

The app has several points where I need to show a Dialog (Modal), then the users can fill some fields and then they can close the dialog. So the system follows its natural path.

In determined moments this works fine. The dialog is shown, user interacts with it, closes it , ....

But, in others moments (the same code) the dialog doesn't appear automatically. The user needs to execute some external action on device (like change its orientation, touch in the center of the screen, execute scroll gesture, etc). Some action that isn't intuitive at the moment. This behavior makes the user think my app froze. For me it is clear that the dialog was called, simply it wasn't drawed on the screen.

I tryed read about this problem.I did some researches in similar questions without success. I guess the cause is related to EDT.

In short, How can I call a Dialog Modal without breaking EDT-rules. And more specifically, How can I resolve this problem. when I request a dialog to be displayed on the screen, I want it really appears in 100% of cases. Today works randomly.

Additional infomations: My app uses Java 5 yet. Do you recommends migration to Java 8?

======= Additional Informations (1) ===========

This problem is strongly dependent of device model. In MotoG3 (Android 6) this problem is a exception. Rarely it occurs. In my Galaxy Note 8 is the opposite. Always occurs. In Lenovo Vibe5 (Android 6). Frequently occurs. I added these informations. Maybe it help to compound problem picture.

Additional question: Is it possible write a snippet that I can use as a template to execute Dialog Modal call without break some rule of EDT?


回答1:


Turn on the EDT violation detection tool in the simulator which should detect such issues. Inspect potentially problematic cases of Dialog calls and post them specifically if you don't know how to fix them.

Java 8 is unrelated although migrating a project is non-trivial.



来源:https://stackoverflow.com/questions/40268968/modal-dialog-does-not-appear

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!