Android的屏幕上的键盘自动弹出 [英] Android on-screen keyboard auto popping up

查看:185
本文介绍了Android的屏幕上的键盘自动弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个应用程序已经有一个开屏(基本菜单)的的EditText 随后几个按钮秒。问题是,我的几位用户也报告说,当他们打开应用程序它会自动弹出屏幕上的键盘没有他们甚至触及的EditText 。据我所知,所有这些用户都使用 HTC Hero的

这是在1.5中的错误?有什么我可以做些什么?

解决方案

您可以用code以下行活动的onCreate方法,以确保当用户点击键盘时,只弹出到一个EditText

<$p$p><$c$c>this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

One of my apps has an "opening screen" (basically a menu) that has an EditText followed by several Buttons. 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.

Is this a bug in 1.5? Is there anything I can do about it?

解决方案

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的屏幕上的键盘自动弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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