I've found a plethora of older unanswered questions about this, so I'm
adding one more in the hope that someone has now found a solution.

I have an EditText inside a ListView (Specifically its in a custom
Preference inside a PreferenceScreen, but a simple ListView is enough
to replicate it). When the EditText is touched, the software keyboard
is popped up and the EditText "loses focus". You can retouch the
EditText and try to type, but when the predictive text suggests a word
it again "loses focus" and empties itself.

Upon inspection the EditText's parent view is being recreated, which
explains the losing focus and content. Digging a little deeper
Preference's getView(View convertView, ViewGroup parent) is being
called with a blank convertView, rebuilding the entire view rather
than reusing the existing one. I don't know if that's the right place
to be looking, or if that is normal for a ListView child. The view is
also recreated as the user scrolls (which makes scrolling somewhat
slower, but that's another issue).

I don't really know where to go from here. A PreferenceScreen expects
a ListView so I can't just change the view to LinearLayout or
something. I also don't really want to give up the custom EditText
preferences as they fit very well in the context they are being used.

Any ideas on how to stop this issue would be great.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to