如何解决“无法连接到编辑器以检索文本”错误?

问题描述 投票:6回答:1

我正在使用listview,listview中每个项目的布局如下。

<?xml version="1.0" encoding="utf-8"?> 
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:orientation="horizontal"
           android:padding="15dp">

     <TextView
         android:id="@+id/barcodeTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:gravity="center"
         android:text="Medium Text"
         android:textAppearance="?android:attr/textAppearanceMedium"/>

     <TextView
         android:id="@+id/pdtDescTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:gravity="center"
         android:maxLength="40"
         android:layout_marginLeft="5dp"
         android:text="Medium Text"
         android:textAppearance="?android:attr/textAppearanceMedium"/>

     <TextView
         android:id="@+id/qtyTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:layout_weight="1"
         android:ems="10"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:text="Medium Text"
         android:textAppearance="?android:attr/textAppearanceMedium"/>

     <TextView
         android:id="@+id/retndQtyTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:ems="10"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:textAppearance="?android:attr/textAppearanceMedium"/>

     <EditText
         android:id="@+id/retQtyEt"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:ems="10"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:hint="@string/return_quantity"
         android:imeOptions="flagNoExtractUi|actionDone"
         android:inputType="number"
         android:singleLine="true"/>

     <Spinner
         android:id="@+id/mrpSpr"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_marginLeft="5dp"
         android:layout_weight="1"
         android:gravity="center"/>

     <EditText
         android:id="@+id/mrpEt"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:ems="10"
         android:gravity="center"
         android:hint="@string/mrp"
         android:layout_marginLeft="5dp"
         android:imeOptions="flagNoExtractUi|actionDone"
         android:inputType="numberSigned"
         android:singleLine="true"/>

     <EditText
         android:id="@+id/unitPrcEt"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:ems="10"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:hint="@string/unit_price"
         android:imeOptions="flagNoExtractUi|actionNext"
         android:inputType="number"
         android:singleLine="true"/>

     <TextView
         android:id="@+id/vatAmtTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:text="Medium Text"
         android:textAppearance="?android:attr/textAppearanceMedium"/>

     <EditText
         android:id="@+id/netAmtEt"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:ems="10"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:hint="@string/net_amt"
         android:imeOptions="flagNoExtractUi|actionDone"
         android:inputType="numberSigned"
         android:singleLine="true"/>

     <TextView
         android:id="@+id/totAmtTv"
         android:layout_width="75dp"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:layout_weight="1"
         android:layout_marginLeft="5dp"
         android:gravity="center"
         android:text="Medium Text"
         android:textAppearance="?android:attr/textAppearanceMedium"/> 
</TableRow>

当我尝试编辑mrpEt edittext中的文本时,android软键板没有响应,我收到以下错误。

02-21 14:42:33.157 651-651/? I/LatinIME: Starting input. Cursor position = 1,1
02-21 14:42:33.172 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.173 4564-4564/? W/IInputConnectionWrapper: requestCursorAnchorInfo on inactive InputConnection
02-21 14:42:33.175 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.178 651-651/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
02-21 14:42:33.208 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.210 651-651/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
02-21 14:42:33.210 651-651/? W/RichInputConnection: Unable to connect to the editor. Setting caps mode without knowing text.
02-21 14:42:33.221 651-651/? I/LatinIME: Starting input. Cursor position = 4,4
02-21 14:42:33.258 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.260 651-651/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
02-21 14:42:33.273 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.274 651-651/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
02-21 14:42:33.274 651-651/? W/RichInputConnection: Unable to connect to the editor. Setting caps mode without knowing text.
02-21 14:42:33.285 651-651/? I/LatinIME: Starting input. Cursor position = 1,1
02-21 14:42:33.303 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
02-21 14:42:33.308 4564-4564/? W/IInputConnectionWrapper: requestCursorAnchorInfo on inactive InputConnection
02-21 14:42:33.316 4564-4564/? W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection

这也仅在Lollipop版本模拟器中发生,但在kitkat版本中不发生。如何解决这个问题?

android android-layout android-edittext
1个回答
0
投票

您提到的错误不属于列表视图。这是logcat错误。重启你的Logcat希望它对你有用。

© www.soinside.com 2019 - 2024. All rights reserved.