Android: EditText not updating when entering text

In my application, the following:

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 a dialog appears, and I'm trying to type text - edit the text without updating. The keyboard shows that the keys are pressed (I see the keyboard prompts - I use the gingerbread keyboard), but nothing changes in the edittext. What should I do?

UPD: see the video with the question: youtu.be/XOSXDSZvisI

+4
source share
4 answers

Have you tried setting your EditText to focus AFTER adding the view?

0
source

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

Try requestFocus () instead.

0
source

I also have this error on my HTC Desire, but when I wait about 1-2 minutes, all edittext work fine after some os log system. So, I think the problem is not in your code.

0
source

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

 editText.setTextColor(Color.BLACK); 
0
source

All Articles