Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Sorting a merged cursor

I'm wondering if there's any way to merge two cursors together and then resort them.

I can easily merge two cursors together by using a MergedCursor, but that doesn't sort them.

I have two sets of contacts in two separate cursors (with totally different schemas) and I want to merge them and sort them by name (the name column is different in the two cursors).

Is this possible?

like image 544
tonyc Avatar asked Aug 07 '26 16:08

tonyc


1 Answers

Perhaps you should rather create an SQL query that returns a cursor that contains all data that you want to view than to create two different query and try to merge them once you have a cursor?

like image 63
Christian Avatar answered Aug 09 '26 05:08

Christian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!