0

I have a ListView where every item has an EditText, when I focus on the last items the soft keyboard appears, but the EditText does not so it stays in the bottom of the screen, what can I do ?

I have this in my manifest

android:windowSoftInputMode="adjustPan|adjustResize"
TootsieRockNRoll
  • 3,218
  • 2
  • 25
  • 50

2 Answers2

1

I would suggest you to make the listview scroll to the clicked EditText, so (I guess) it will be displayed in the visible part of the screen. As in this question Programmatically scroll to a specific position in an Android ListView, you should identify which item has been clicked and then scroll to it.

Community
  • 1
  • 1
fiipi
  • 663
  • 6
  • 20
  • I believe if the item is in the very bottom, there is no more room for scrolling it there ? – TootsieRockNRoll Feb 18 '14 at 17:27
  • I don't know exactly what happens, but I think you're right, if there's no room it can't scroll there. See [this question](http://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field) and also [this blog post](http://android-developers.blogspot.it/2009/04/updating-applications-for-on-screen.html), maybe the answer is to use _extract mode_. – fiipi Feb 18 '14 at 17:47
0

Try using Adapter's getLastVisiblePostition:
http://developer.android.com/reference/android/widget/AdapterView.html#getLastVisiblePosition()

Then on the click of EditText, setSelection for the ListView(depending on the height of soft keyboard and each item row of the ListView);
http://developer.android.com/reference/android/widget/AdapterView.html#setSelection(int)

Pararth
  • 8,114
  • 4
  • 34
  • 51