Thanks for the reply Kostya, I think that querying info from 2 different URIs, merging them programatically and then converting them to arrays before displaying the listview won't probably be pretty efficient. Maybe this is the only solution but I still think there should be a way of:
- Querying the information with the relationships I need (query only albums with mp3 files inside) - Querying all albums and displaying only the ones with mp3 files (need to know how to filter content from a cursor before it is displayed in the expandablelistview) Thanks, Gabriel On May 22, 12:33 pm, Kostya Vasilyev <[email protected]> wrote: > You don't have to use Cursor with an expandable list view or any adapter > view. Do your own filtering and create an in-memory array of just the > albums you need, then change your adapter code to get data from this > array, instead of a cursor. > > Perhaps there is a better way, but I can't think of one right now (like > creating your own Cursor class that intercepts calls to the real cursor, > filtering data on the fly, but that would get really messy really fast). > > -- Kostya > > 22.05.2011 19:20, Gabriel Simões пишет: > > > > > > > > > > > Please, any idea/tip will be of great help! > > I´m stuck on this one. > > > Tnx, > > Gabriel Simões > > > On May 21, 9:49 pm, Gabriel Simões<[email protected]> wrote: > >> Hello, > > >> I´ve been searching on the web and here for information but couldn´t > >> find anything related to this problem so I hope you can help me. > >> I´m retrieving information from 2 diferent content providers that are > >> related. Information from one content provider (songs list) should > >> define the rules to filter another group of info (albums). > > >> I´m trying to create an expandablelistview where only the albums which > >> have mp3 files would be listed as headers, and the mp3 songs would be > >> in the second level list. > > >> At first I tried to figure out a way of implementing ContentProvider > >> searches that would allow me to recover only the required data but I > >> couldn´t find a way to do it (use group by, relate both > >> contentproviders in the same query, ...). Then I tried to retrieve the > >> info and filter programatically but the Cursor class doesn't have > >> methods to remove or filter information. > > >> After I tried to figure out a way to implement the rule in a > >> CursorAdapter but while I can customize the information handling, I > >> couln´t find a way of blocking some retrieved Cursor "lines" so I > >> could display only albums with at least one mp3 file. > > >> Please, throw some light in here. How can I archive this result? > > >> Thanks, > >> Gabriel Simões > > -- > Kostya Vasilyev --http://kmansoft.wordpress.com -- 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

