草庐IT

InputConnectionWrapper

全部标签

android - InputConnectionWrapper 警告

每次当我的应用程序可见时关闭屏幕时,我都会收到InputConnectionWrapper警告。我不知道为什么,因为我没有使用InputConnection。这是LogCat输出。09-0714:21:31.716:W/IInputConnectionWrapper(24197):getExtractedTextoninactiveInputConnection09-0714:21:31.724:W/IInputConnectionWrapper(24197):getExtractedTextoninactiveInputConnection09-0714:21:31.724:W/II

android - 如何使用 InputConnectionWrapper?

我有一个EditText。现在我想获取用户对此EditText所做的所有更改,并在将它们手动插入到EditText之前使用它们。我不希望用户直接更改EditText中的文本。这只能由我的代码完成(例如,通过使用replace()或setText())。我搜索了一下,发现了一个有趣的类,名为InputConnectionWrapper。根据javadoc,它应充当给定InputConnection的代理。所以我像这样对其进行子类化:privateclassEditTextInputConnectionextendsInputConnectionWrapper{publicEditText