Figuring out which items are visible is pretty easy, you can use
ListView.getFirstVisiblePosition() to know what section of your adapter is
visible (getFirstVisiblePosition() + getChildCount() - 1 gives you the last
visible position.)

On Sat, Apr 30, 2011 at 8:35 PM, Eric <[email protected]> wrote:

>
>
> On Apr 30, 11:29 pm, Dianne Hackborn <[email protected]> wrote:
> > I'm not sure what more to say except that this isn't how
> > notifyDataSetChanged() is supposed to be used.  It is for relatively
> > infrequent, significant changes to the underlying data.  The typical case
> is
> > when a new query has been done in a database and the adapter is being
> > switched to show the data of the new cursor.
>
> Let me simplify this.  Do you know of a Google example code you could
> point me to that shows a ListView with many items updating itself,
> without calling notifyDatasetChanged()?  Where the items in the list
> are updating in real time?
>
> How is my View code supposed to know which list items are visible?
> Why should I be responsible for updating the cells if they aren't even
> on the screen?  I'd need a pointer to all of the ListView subviews.
> Why isn't there simply a method on Adapter named,
> notifyDatasetChangedAtIndexes(int[] indexes), so that the ListView can
> be smart about merging the changes that I tell it about, with only the
> cells that are currently visible?
>
> --
> 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
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  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