tags:

views:

33

answers:

1

I'm torn about how to implement this because Content Provider URI querys do not support the simple SQL "DISTINCT" query method to return a cursor to the Artists of the songs in the mediastore, removing any duplicate entries.

I can query and get a cursor to all the artists, I'm just torn as to how to remove the dupes, or simply not show them.

I've tried using matrixcursor to construct a new cursor with the dupe entries removed, but it's slow (build an array of artists, if in that array don't copy to the new matrixcursor, etc.)

Can anyone recommend a better solution, or point me in the proper direction??

I've also thought about pre-loading the information i need into an array of objects - I'm just concerned with memory overhead in my application.

Thank You for any help you may provide.

A: 

You might want to try creating stateful CursorWrapper, overriding the appropriate methods. Simply ensure every call to next() iterates through the cursor until it finds an artist name you consider appropriately unique, optionally storing seen artists in an ArrayList instance variable.

Mark B.