Android 对话框和滑出键盘的问题
我的 Android 应用程序设置了一个带有编辑文本字段的对话框。如果在滑出式键盘关闭的情况下显示对话框,然后打开键盘,则该对话框(有时)会消失。该应用程序进入了梦幻之地。我用的是LG Alley。
是否有打开键盘滑块的事件?我可以捕获并控制这种情况的事件吗?关于如何处理这个问题有什么建议吗?
My Android application puts up a Dialog with and Edit Text field. If the dialog is displayed with the slide out keyboard closed and then the keyboard is opened, the dialog box (sometimes) disappears. The application goes off into never-never land. I am using a LG Alley.
Is there an event for opening a keyboard slider? An event I can capture and gain control over this situation? Any advice as to how to deal with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您可能会看到“配置更改”的结果 - 请参阅 处理运行时更改。
设备方向的更改或打开/关闭“硬”键盘之类的事情会导致当前正在运行的 Activity 被销毁并重新创建,您需要将内容恢复到更改之前的状态。
与其说是监听事件,不如说是能够从一开始就“追溯你的脚步”。
I think you're possibly seeing the result of a 'configuration change' - see Handling Runtime Changes.
Things like a change in device orientation or opening/closing a 'hard' keyboard cause the currently running Activity to be destroyed and re-created and you need to restore things to the way they were before the change.
Not so much listening for an event but more a case of being able to 'retrace your steps' from the start.
我发现将此类语句添加到清单文件可以解决问题
I found that adding this type of statement to the manifest file fixes the problem