问题描述
我有 2 个活动,a 和 b.当 a 启动时,它会检查一个条件,如果为真,它会调用 startactivityforresult() 来启动 b.b 只接受文本输入,所以这是有意义的b启动时软键盘自动弹出.当活动开始时,edittext 已经有了焦点并准备好输入.
i have 2 activities, a and b. when a starts, it checks for a condition and if true, it calls startactivityforresult() to start b. b only takes text input so it makes sense for the soft keyboard to automatically pop up when b start. when the activity starts, the edittext already has focus and it ready for input.
问题是键盘永远不会出现,即使在清单中为 b 的
the problem is that the keyboard never shows up, even with windowsoftinputmode="statealwaysvisible" set in the manifest under the
有人知道解决办法是什么吗?
anyone know what the solution might be?
推荐答案
最适合我的是在 android manifest 中添加活动 b
what worked best for me is in android manifest for activity b adding
android:windowsoftinputmode="statevisible"
希望对你也有帮助.