开发者

How to sort MergeCursor?

The task is to combine data from 2 different tables with similar columns, sorted开发者_JS百科 by one column . Seems like MergeCursor might help, but have no idea how to sort items.

The only solutions I see now is converting manually to ArrayAdapter, or do sneaky JOINs (not sure yet its possible)

Thanks.


MergeCursor does not offer sorting.

The only solutions I see now is converting manually to ArrayAdapter, or do sneaky JOINs (not sure yet its possible)

I have no idea what the latter is. If you want to stick with the Cursor interface, you can build yourself a MatrixCursor. Or, you can try to create your own CursorWrapper that maintains the sort order and rewrites all position-related calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜