multi column Custom list view with an editable edit text at the end of the list view
I am on Android 2.1 and I have one multi column Custom listview Using BaseAdapter with an editable edittext at the end of the listview. If the data in the listview do not contain the data of user choice then user should be able to enter data. If the data is already there in the list user will be able to select the data using cust开发者_运维知识库om selector. If a selection is made in the list view and user wanted to enter data in the text field at the bottom after selection then the marker in the list view should be unselected. I tried to use onclick() method on edit text using click listener. First time when it is clicked, edit text is getting focus and onclick() method is not fired. And when it is clicked second time, onclick() method is fired and notifyDataSetChanged() method is called. I tried to call the notifyDataSetChanged() method from the Focus Listener, list view selection is gone in my first attempt and edit text is not receiving any data input from the keyboard (frozen).Please help. Thanks, Venkat
Finally I fixed it. notifyDataSetChanged() on focus gained of edittext is recursively calling itself.Hence this issue was there. So, rather than calling notifyDataSetChanged() from focus listener I used a method in the activity to update the list from the focus listener of the edittext. Hence there was no issues of recursion with notifyDataSetChanged().
精彩评论