notityDataSetChanged rebuilds the view list, so yes, that could cause UI events to be missed.

As far as updating an {Expandable}ListView in a more efficient way - if you just need to refresh a few UI widgets - this can be done by:

- Asking the list view for the currently visible range of item views: getFirstVisiblePosition / getLastVisiblePosition

- Iterating over these positions, calling getChildView to get their views, remembering that child views are always numbered starting at 0, even if the view is scrolled down.

- Reaching into the item views by calling childView.findViewById and "pushing" changes with textView.setText, etc.

Don't forget also that a list view can be out of sync with its adapter (a layout is pending, but not yet performed), so to get a particular item view's data item, use a tag set inside get{Child|Group}View, and not the adapter's getChild / getGroup.

-- Kostya

01.11.2011 12:35, Ash пишет:

It is found that on several occasions the button click on the image button is ignored. Could this be related to the notifyDataSetChanged being called every second? If I stop my timer then button clicks are more responsive.

Can you please advice if there is other way of displaying a timer on the group view or the way I am currently doing it is acceptable?

--
Kostya Vasilyev

--
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