EditText inside ListView will not stay focused

android, android-edittext, focus, listview

Solution

`EditText`s within `ListView`s are extremely tricky. I'd suggest you avoid them like the plague if possible. When I was messing with them, this answer was helpful though. If you only have a few items you can always just use a `ScrollView`.

Problem

I have an `EditText` inside each row of a `ListView`. For some reason, when I tap the EditText, it briefly gains focus but then immediately loses it. I have tried these things: ``` listView.setItemsCanFocus(true); editText.setFocusable(true); ``` While the `EditText` is (briefly) focused, the `Enter` key says `Next` and the `auto-correct bar` is present. When it loses focus, the soft keyboard stays up, but the `Enter` key becomes a `Return Arrow`, and the `auto-correct bar` disappears.

Original source

Related problems