模态对话框不出现 [英] Modal Dialog does not appear

查看:52
本文介绍了模态对话框不出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有一个令人讨厌的行为.这给我的顾客带来了麻烦.

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.

我尝试阅读有关此问题的信息.我对类似问题进行了一些研究,但均未成功.我想原因与EDT有关.

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

简而言之,如何在不破坏EDT规则的情况下调用对话模态.更具体地说,我该如何解决此问题.当我要求在屏幕上显示一个对话框时,我希望它确实出现在100%的情况下.今天是随机工作.

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.

其他信息:我的应用程序仍使用Java 5.您是否建议迁移到Java 8?

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

========其他信息(1)==========

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

此问题在很大程度上取决于设备型号.在MotoG3(Android 6)中,此问题是一个例外.很少发生.在我的Galaxy Note 8中是相反的.总是发生.在Lenovo Vibe5(Android 6)中.经常发生.我添加了这些信息.也许有助于复合问题图片.

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.

其他问题:是否可以写一个可用作模板的代码段执行对话框模态调用而不会破坏EDT的某些规则?

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?

推荐答案

打开模拟器中的EDT违规检测工具,该工具应能够检测到此类问题.检查 Dialog 调用中可能存在问题的情况,并在不知道如何解决它们的情况下专门进行张贴.

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却无关紧要.

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

这篇关于模态对话框不出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆