有序游标列表视图
我有一个关于将 SimpleCursorAdapter 与 ListView 一起使用的简单问题。我注意到我的光标保留了它的内部结构,但是与 SimpleCursorAdapter 连接的 ListView 似乎以奇怪甚至随机的顺序显示光标中的对象。
重要的是,我的列表视图按照光标中对象出现的顺序显示光标对象。这可能吗?
感谢您的帮助!
编辑:看来问题不在于 ListView 或 Cursor。问题是使用 WHERE IN (x,y,z) 子句返回的 Cursor 不一定具有 x、y、z 的顺序。很抱歉发布误导性的查询。
I have a simple question about using SimpleCursorAdapter with ListView. I've noticed that my cursor retains it's internal structure, but that the ListView connected with a SimpleCursorAdapter seems to display the objects in the cursor in a odd, or even random, order.
It's important that my list view display the Cursor's objects in the same order that they appear in the Cursor. Is this possible?
Thanks for any help!
EDIT: It appears that issue is not with ListView or Cursor. The issue is that a Cursor returned by using a WHERE IN (x,y,z) clause will not necessarily have the order x, y, z. Sorry for posting the misleading query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的光标适配器以相反的顺序显示列表视图中的项目...不是随机的...检查一下
Simple cursor adapter shows items in listview in reverse order... Not random... Check it out