显示软键盘活动开始时, [英] Show soft keyboard when Activity starts

查看:122
本文介绍了显示软键盘活动开始时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有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.

现在的问题是,该键盘一直没有出现,甚至与 windowSoftInputMode =stateAlwaysVisible在清单中设置<活性GT; 标记B.我也试图与>设置为 stateVisible

The problem is that the keyboard never shows up, even with windowSoftInputMode="stateAlwaysVisible" set in the manifest under the <activity> tag for B. I also tried with the value set to stateVisible. Since it doesn't show up automatically, I have to tap the EditText to make it show.

任何人都知道的解决方案可能是什么?

Anyone know what the solution might be?

推荐答案

什么为我工作最好是在Android清单的活动b。加入

What worked best for me is in Android Manifest for activity B adding

安卓windowSoftInputMode =stateVisible

希望帮助为你。

这篇关于显示软键盘活动开始时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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