android - How to represent 2 cursors as 1 sorted cursor? -


i have 2 different sets of data, each of them use own contentprovider. querying them can 2 different cursors. 2 cursors has 2 different primary keys, there's 1 , same field (date) can use ordering (other fields different).

my goal have 1 final merged cursor sorted date field. have investigated mergecursor doesn't fit me, since returns merged/concatenated (but not sorted cursor).

any ideas, clues?

you can try class aosp repository: https://android.googlesource.com/platform/frameworks/base.git/+/android-4.4.4_r1/core/java/com/android/internal/database/sortcursor.java

there performance warning @ beginning of class if don't have 10k or 100k records might fine.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -