4

I have following in my app:

layout/dialog_edit_group.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/dlgEditGroup"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent">
<EditText android:id="@+id/txtGroup"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:hint="Group Name"
          android:inputType="text"
          android:singleLine="true"
          android:editable="true"/>

my activity (onCreateDialog method):

        ...
        LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
        View layout = inflater.inflate(R.layout.dialog_edit_group, (ViewGroup) findViewById(R.id.dlgEditGroup));
        EditText txtGroup = (EditText) layout.findViewById(R.id.txtGroup);
        txtGroup.setFocusable(true);
        builder.setView(layout);
        return builder.create();

When dialog appears and I try to type text - edit text not updates. Keyboard shows that keys are pressed (I see keyboard hints - I use gingerbread keyboard), but nothing changes in edittext. What I need to do?

UPD: see video with issue: youtu.be/XOSXDSZvisI

newmindcore
  • 318
  • 3
  • 8
  • addition: on each key press in logcat adding next: `WARN/IInputConnectionWrapper(2517): commitText on inactive InputConnection` – newmindcore Apr 25 '11 at 11:58

5 Answers5

3

The main reason behind this is maybe in your manifest file

The main problem is with this line in your manifest file:

<application android:hardwareAccelerated = "false">

To make the text you have typed to be updated in the editText field remove this line in your manifest file:

android:hardwareAccelerated = "false"

(or)

Modify the line as:

android:hardwareAccelerated = "true"

I am answering this question late, but I hope that maybe it would be useful for who are still facing this problem.

0

For those still looking for this answer, I solved my problem by setting color of EditText to BLACK

editText.setTextColor(Color.BLACK);
Dino Velić
  • 888
  • 11
  • 24
0

Have you tried setting the EditText to focusable AFTER adding the view?

Rajath
  • 11,787
  • 7
  • 48
  • 62
  • yes, nothing changed. but in logcat now `WARN/IInputConnectionWrapper(2629): sendKeyEvent on inactive InputConnection` – newmindcore Apr 25 '11 at 12:00
0

setFocusable(true); just makes the widget focusable and in the case of EditText is focusable by default.

Try requestFocus() instead.

Macarse
  • 91,829
  • 44
  • 175
  • 230
0

I have got this error on my HTC Desire too, but when I wait about 1-2 min, all edittext work normal after some system os log. So, I think problem is not your code.

xtr
  • 5,870
  • 1
  • 21
  • 23