In my application I have an activity to add/remove/edit records inside a SortedMap
. The activity is implemented as an extension of ListActivity
. I have implemented custom ArrayAdapter
for the collection items.
Every ListView
item (which corresponds to an underlying record) consists of TextView
s, EditText
s, and a Button
to delete the record itself. The layout is roughly as follows:
ListView
----------------------------------------------------
[TextView] [EditText] [TextView] [EditText] [Button]
----------------------------------------------------
[TextView] [EditText] [TextView] [EditText] [Button]
My goal is to process the input a user types to the EditText
s as soon as the user finished editing, i.e. when the user has navigate away from the EditText
or the user has pressed back to dismiss the onscreen keyboard.
I have tried implementing this by handling onFocusChanged
, to process the text visible in the EditText
. However this method is not working well, onFocusChanged
method is called very often and randomly, even for unselected & unedited EditText
s. This is probably due to this article on Android Blog from this StackOverflow question.
Is there a better way to do this?