问题描述
我的一个应用程序有一个打开屏幕"(基本上是一个菜单),其中有一个 EditText
后跟几个 Button
.问题是我的一些用户报告说,当他们打开应用程序时,它会自动弹出屏幕键盘,而他们甚至没有触摸 EditText
.据我所知,所有这些用户都在使用 HTC Hero.
One of my apps has an "opening screen" (basically a menu) that has an EditText
followed by several Button
s. The problem is that several of my users are reporting that when they open the app it's automatically popping up the on-screen keyboard without them even touching the EditText
. As far as I can tell, all of these users are using the HTC Hero.
这是 1.5 中的错误吗?有什么我可以做的吗?
Is this a bug in 1.5? Is there anything I can do about it?
推荐答案
您可以在活动的 onCreate 方法中使用以下代码行来确保键盘仅在用户单击 EditText 时弹出
You can use the following line of code in the activity's onCreate method to make sure the keyboard only pops up when a user clicks into an EditText
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
这篇关于Android 屏幕键盘自动弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!