如何排序MergeCursor? [英] How to sort MergeCursor?

查看:228
本文介绍了如何排序MergeCursor?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的任务是将数据从具有类似的列2个不同的表,排序由一列结合。 好像MergeCursor可能有帮助,但不知道如何排序的项目。

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

我现在看到的是手动转换为ArrayAdapter,还是偷偷摸摸加入唯一的解决方案(目前还不能确定其可能的)

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

感谢。

推荐答案

MergeCursor 不提供排序。

我现在看到的是手动转换为ArrayAdapter,还是偷偷摸摸加入唯一的解决方案(目前还不能确定其可能的)

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

我不知道后面是什么。如果你想坚持使用光标的界面,你可以建立自己一个 MatrixCursor 。或者,你可以尝试创建自己的 CursorWrapper 维持排序顺序,并把所有的位置相关的调用。

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.

这篇关于如何排序MergeCursor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆