On Fri, Apr 29, 2011 at 3:20 PM, Eric <[email protected]> wrote:

> Let's say the most noticeable one is clicking an item in a list view.
> Note that my list view updates itself quite often to display realtime
> data.  Do I need to do something special to avoid touch events being
> lost in the case where my list view is updating 1-2 times a second?  I
> would not think so, because the main thread should not be hijacked by
> anything.  I have all my data processing being done in a BACKGROUND
> priority thread.
>

Ah.  If you are doing an actual data change, the list view needs to rebuild
the list at that point, and likely the touch will be lost.  You really don't
want to be doing a big data update every second for numerous reasons: it is
expensive so causes a lot of CPU use, it will result in non-smooth scrolling
since all of the views being shown in the list need to be rebuilt each time,
if your data is actually changing that much then it will be changing
continually on the user (including items potentially moving around) which is
not a good UX, and finally since all of the views are being rebuilt the one
the user is currently touching is likely to be rebuilt and the current touch
lost.

A list view is definitely not the way to show "real time" data like this.
 If the items *inside* of the list view want to update at a frequent rate to
show new data they can certainly do that by just changing their visuals, but
you don't want to tell the list view that your data set has changed because
then it needs to throw all of its current views away, retrieve the new data,
and bind that data to new views.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to