InputConnectionWrapper 警告 [英] InputConnectionWrapper warning

查看:30
本文介绍了InputConnectionWrapper 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次当我的应用可见时关闭屏幕,我都会收到 InputConnectionWrapper 警告.我不知道为什么,因为我不使用 InputConnection.

I get an InputConnectionWrapper warning everytime I turn off the screen when my app is visible. I don't know why, because I don't use InputConnection.

这是 LogCat 输出.

Here is the LogCat Output.

09-07 14:21:31.716: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:31.724: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): beginBatchEdit on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): endBatchEdit on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): beginBatchEdit on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): endBatchEdit on inactive InputConnection
09-07 14:21:31.732: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:32.013: W/IInputConnectionWrapper(24197): showStatusIcon on inactive InputConnection
09-07 14:21:32.013: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): beginBatchEdit on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): endBatchEdit on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextBeforeCursor on inactive InputConnection
09-07 14:21:32.021: W/IInputConnectionWrapper(24197): getTextAfterCursor on inactive InputConnection
09-07 14:21:32.028: W/IInputConnectionWrapper(24197): beginBatchEdit on inactive InputConnection
09-07 14:21:32.028: W/IInputConnectionWrapper(24197): endBatchEdit on inactive InputConnection
09-07 14:21:32.028: W/IInputConnectionWrapper(24197): getExtractedText on inactive InputConnection

推荐答案

我正在使用 webView 浏览一个 URL,我需要注册或登录该 URL.当我将焦点切换到不同的 TextField,我在上面遇到了相同的错误.

I am using a webView to browse a URL of which I am required to either sign-up or log in. My app just froze when I switched focus to a different TextField and I got the same errors above.

我设法解决它的方法是它缺少下面这段重要的代码:

How I manage to resolve it is that it was missing this crucial piece of code below:

@override
void initState() {
  super.initState();
  if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}

此代码应位于扩展主类的实例类声明之后,构建 Widget 函数之前.

This code should lie after the declaration of the instance class that extends the main class and before the build Widget function.

在错误日志中,您可能仍会看到相同的警告,但它肯定会解决导致的任何问题,无论是 Swift 键盘还是 TextField 本身.

In the error logs you might still see the same warnings but it will definitely resolve whatever issues were being caused, whether it was the Swift keyboard or the TextFields themselves.

这篇关于InputConnectionWrapper 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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