Android的软键盘不工作 [英] Android soft keyboard not working

查看:209
本文介绍了Android的软键盘不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,无法正常工作影响的软键盘。

I'm having a weird problem with effecting the soft keyboard from working properly.

我的应用程序并没有一个单一的EditText视图,或者以某种方式使用键盘,但在多个设备上安装我的应用程序,使用它,然后回到使用该设备的软键盘停止工作后,不知何故,和它的驾驶我疯了...

My app does not have a single EditText view in it, or using the keyboard in some way, but somehow after installing my app on several devices, working with it and then going back to use the device the soft keyboard stop working, and it's driving my crazy...

什么,用户看到的是,当他/她点击在软键盘没有一个字符按钮显示在EditText上为每一个应用程序。就像我说的奇怪的问题影响整个系统,用户可以不写任何东西。

What the user sees is that when he/she clicks on a character button in the soft keyboard nothing is shown in the EditText for every app. Like I said the weird problem effects the entire system and the user can't write anything.

我的应用程序包含了所有类​​型的功能,所有正在与standered API,所以我不明白,我怎么可能会导致此,或至少触发了。

My app contains all kind of features, all is working with standered API, so I don't understand how can I cause this, or at least trigger it.

在键盘不能正常使用的键盘按钮,用户点击一下,你可以在logcat中看到:

When the keyboard is not working and the user click on the keyboard buttons you can see in the logcat:

WARN/IInputConnectionWrapper(1628): sendKeyEvent on inactive InputConnection
WARN/IInputConnectionWrapper(1628): getCursorCapsMode on inactive InputConnection
WARN/IInputConnectionWrapper(1628): endBatchEdit on inactive InputConnection

如何在InputConnection可以变得不活跃,是有办法激活它?

How an InputConnection can become inactive and is there a way to activate it?

我想知道如果任何人有这样那样的问题,什么是对的原因是什么?

I was wondering if anyone had this kind of problem and what was the cause of that?

推荐答案

看起来你的输入连接没有正确关闭。我有类似的问题,并固定它在下列方式:

Looks like your Input Connection has not been closed properly. I had similar issue and fixed it in following way:

EditText editTextLogin = (EditText) findViewById(R.id.editTextLogin);
editTextLogin.requestFocus();
InputMethodManager inputManager = (InputMethodManager)context.getSystemService(INPUT_METHOD_SERVICE);
inputManager.restartInput(editTextLogin);

这篇关于Android的软键盘不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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