0

I have a ListView with a custom CursorAdapter feed from a MatrixCursor. Each row in the ListView has an image that is loaded asynchronously, and when the image loading completes, I would like to signal the adapter to redraw the row in question. I do something similar already with data from a ContentProvider where I call getContentResolver().notifyChange to redraw a specific row. For a MatrixCursor, I can call notifyDataSetChanged, but that's not optimal, as it refreshes every row.

So my question is, what's the best way to go about redrawing specific rows in a ListView from a temporary source? Is there a way to set up "temporary" ContentUris, or some way to request that the adapter only invalidate specific rows?

user
  • 86,916
  • 18
  • 197
  • 190
Melllvar
  • 2,056
  • 4
  • 24
  • 47

1 Answers1

0

I was able to achieve the same effect using setNotificationUri on MatrixCursor with an arbitrary URI, then using getContentResolver.notifyChange() to signal a redraw. While this works for me, I'd be curious to know whether this is an advised way of requesting redraw of specific items.

Melllvar
  • 2,056
  • 4
  • 24
  • 47