首页 > 代码库 > Android showStatusIcon on inactive InputConnection异常

Android showStatusIcon on inactive InputConnection异常

在开发的时候突然发现在输入文本框中点击输入法的删除按钮,发现app莫名其妙退出 了。log信息如下:

01-31 16:57:59.524: W/IInputConnectionWrapper(1259): clearMetaKeyStates on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): clearMetaKeyStates on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): beginBatchEdit on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): getTextBeforeCursor on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): endBatchEdit on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): sendKeyEvent on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): sendKeyEvent on inactive InputConnection
01-31 16:57:59.624: W/IInputConnectionWrapper(1259): clearMetaKeyStates on inactive InputConnection
01-31 16:57:59.684: W/IInputConnectionWrapper(1259): showStatusIcon on inactive InputConnection

后来各种查找,发现原来自己在Activity中重写了onKeyDown方法直接退出了Activity。


所以出现了这种Warn的时候请看看自己代码是否重写了onKeyDown或onKeyUp方法,检查下是否有逻辑上的错误。


Android showStatusIcon on inactive InputConnection异常