I would like to have a custom ListView, where each row contains an EditText field, that may be edited by the user. But when I click on one of the EditTexts I lose the focus, and can't type text there (I suppose because the other rows are redrawn and get the focus). What can I do?
Asked
Active
Viewed 1.1k times
2 Answers
23
If the problem is related to software keyboard, try to set windowSoftInputMode to adjustPan in activity declaration in AndroidManifest.xml as follows:
...
<activity
android:name=".activity.Activity"
android:label="@string/activity"
android:windowSoftInputMode="adjustPan" />
...
It should help. Check http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html for more info about it.

Ondra Zahradnik
- 683
- 6
- 10
-
Worked for me. I have several widgets in each line, and some of them are EditText. With your solution I don't lose focus when editing. – ffleandro Feb 02 '12 at 17:36