Skip to content Skip to sidebar Skip to footer

Listview With Edittext Keyboard Issues

In my app, I have an Activity, which contains a Fragment, which contains a ListView with various EditTexts, like so: Activity -> Fragment -> ListView -> EditTexts When an

Solution 1:

The problem is that when you use EditText in a ListView row, your ListView might be redrawn to make space for the keyboard. And when your ListView is redrawn, the system does not remember where the cursor was before.

The same issue does not seem to happen if you use a LinearLayout inside a ScrollView instead of a ListView. It sounds stupid, but it works.

Solution 2:

Recently I have encountered this problem either, and i sloved this problem by adding android:windowSoftInputMode="adjustPan" in AndroidManifest.xml.This will not cause the listview to redraw, so the edittext will not lose its focus.

Post a Comment for "Listview With Edittext Keyboard Issues"