2


I implemented a ListView using ArrayAdapter. Each listItem (row) contains EditText.
When I try to Edit the text of EditText I was not able to do that , because whenever the keyboard appears getView() method is called and I am not able to edit the text.
Can anyone help me in sorting out this issue.

Thanks in Advance

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
user1276092
  • 523
  • 3
  • 8
  • 30
  • Found a similar topic that might be helpfull. -> http://stackoverflow.com/questions/8258692/android-edittext-in-listview-keyboard – Ostkontentitan May 13 '12 at 19:29

1 Answers1

6

If this is the only problem you are facing while editing your EditText, you can eradicate it by adding the following attribute to your Activity in the manifest.

android:windowSoftInputMode="adjustPan"

Something like this,

  <activity
            android:name=".ListEditActivity"
            android:label="@string/app_name" 
            android:windowSoftInputMode="adjustPan">

   </activity>

Now you will not be able to face the problem of clicking your Edittext twice to Edit it. But if you are facing some problems like, getitng wrong values in your EditText while scrolling, I am actually working on it and once I get the solution for it I will update my answer here.

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
  • Hi Selva ! Actually I am using the listView in Fragments . In that case how to handle this situation. I mean how to set this android:windowSoftInputMode as adjustPan – user1276092 May 14 '12 at 06:42
  • Hi Selva ! I have set that parameter to the activity that holds the fragments and it fixed my issue. Thanks very much – user1276092 May 14 '12 at 06:49
  • Yeah.. That's wat I was thinking abt but for a moment I thought that this solution was not working for Fragments.. good to know it works.. keep going.. – Andro Selva May 14 '12 at 06:54
  • hey, do you have the problem of losing of your Edittext values during Scroll event? If not can you give me a little help on that of, how to save the edittext content during scroll ? – Andro Selva May 14 '12 at 06:56