EditText в адаптере возвращает предупреждение: W / IInputConnectionWrapper: getTextAfterCursor для неактивного InputConnection - PullRequest
0 голосов
/ 26 июня 2019

У меня появляется это предупреждение каждый раз, когда я пытаюсь ввести текст в моем editText:

W / IInputConnectionWrapper: getTextAfterCursor для неактивных InputConnection

и хотя программная клавиатура развернута на экране, она не позволяет мне что-либо писать в поле editText.

Текст редактирования находится внутри этого адаптера:

@Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {

        View v = convertView;

        LayoutInflater layoutInflater = LayoutInflater.from(this.contextM);
        v = layoutInflater.inflate(R.layout.list_item_preguntas, null);

        LinearLayout linearLayout = (LinearLayout)v.findViewById(R.id.item_listaPreguntas);
        EditText editText = v.findViewById(R.id.edtObservaciones);

        return v;
    }

А это макет XML :

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/item_listaPreguntas"
    android:orientation="vertical"
    android:background="@drawable/borde_sombras"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
      >

    <EditText
        android:id="@+id/edtObservaciones"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:ems="10"
        android:inputType="text"
        android:hint="@string/observaciones"
        />

</LinearLayout>

Ничего особенного, за исключением того, что editText находится внутри Адаптера, который показан во фрагменте.

Я пробовал все это:

editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
editText.setTextIsSelectable(true);

и это:

editText.requestFocus();
InputMethodManager inputManager = (InputMethodManager)contextM.getSystemService(INPUT_METHOD_SERVICE);
inputManager.restartInput(editText);

и это тоже:

if (editText.length() > 0) {
    TextKeyListener.clear(editText.getText());

И еще несколько ответов, которые я нашел здесь, но, похоже, ничего не работает. Есть идеи, что я делаю не так? Спасибо

}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...