简体   繁体   English

Android,未在软键盘可见性更改时重新创建活动

[英]Android, activity is not recreated on soft keyboard visibility change

When the software keyboard appears/disappears my activity is not restarted. 当软件键盘出现/消失时,我的活动没有重新开始。 Why is this? 为什么是这样? I have not done anything to handle these events myself, as described here: http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange 我自己没有做任何事情来处理这些事件,如下所述: http : //developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange

I have not overridden onConfigurationChanged or declared android:configChanges in the activity entry in the manifest. 我尚未在清单的活动条目中覆盖onConfigurationChanged或声明android:configChanges。 I even tried setting android:configChanges="" in the manifest, but it does not help. 我什至尝试在清单中设置android:configChanges =“”,但这无济于事。

Edit: could it be my listview is catching the event, because I have enabled filtering? 编辑:可能是我的列表视图正在捕获事件,因为我已启用过滤功能?

Edit: disabling text filtering did not fix it. 编辑:禁用文本筛选不能修复它。

Stack overflow is being a bitch and saying I don't have enough karma to answer, so i'll do it here: The solution is to use http://developer.android.com/reference/android/view/View.html#onSizeChanged%28int,%20int,%20int,%20int%29 as the activity is not supposed to restart. 堆栈溢出是个bit子,说我没有足够的业力来回答,所以我在这里做:解决方案是使用http://developer.android.com/reference/android/view/View.html #onSizeChanged%28int,%20int,%20int,%20int%29,因为不应重新启动该活动。

Soft keyboard changes do not trigger configuration change event. 软键盘更改不会触发配置更改事件。 Only hardware keyboard does. 只有硬件键盘可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM