CursorLoader与rawQueryCursorLoader、rawQuery

由网友(活出自己的精彩℡)分享简介:我寻找到我的应用程序执行CursorLoader但我有一个小问题,它似乎没有办法仅仅通过一个原始查询到CursorLoader构造。我可能失去了一些东西的文档(和谷歌),因此,如果任何人都可以点我一个简单的方法来与CursorLoader类我会AP preciate它运行原始查询。否则,我将有可能与必要的功能,而我试图...

我寻找到我的应用程序执行CursorLoader但我有一个小问题,它似乎没有办法仅仅通过一个原始查询到CursorLoader构造。

我可能失去了一些东西的文档(和谷歌),因此,如果任何人都可以点我一个简单的方法来与CursorLoader类我会AP preciate它运行原始查询。否则,我将有可能与必要的功能,而我试图避免创建自己的CursorLoader类。

解决方案   

似乎没有办法仅仅通过一个原始查询到CursorLoader构造。

这是因为 CursorLoader 作品与内容提供商和内容提供商不支持 rawQuery()

  

因此​​,如果任何人都可以点我一个简单的方法来与CursorLoader类运行原始查询我会AP preciate吧。

这是不可能的,对不起。欢迎您来创建自己的 AsyncTaskLoader 击中SQLite数据库,并支持 rawQuery()。事实上,我可能会在今年晚些时候写这些中的一个,如果我没有看到任何人击败了我吧。

Android之cursorLoader进行数据异步加载

I'm looking into implementing CursorLoader in my app but I'm having a small issue that it seems that there isn't a way to just a pass a raw query to the CursorLoader constructor.

I maybe missing something in the documentation (and google), so if anybody can point me to a simple way to run a raw query with a CursorLoader class I would appreciate it. Otherwise I will have to probably create my own CursorLoader class with the necessary functionality, which I'm trying to avoid.

解决方案

it seems that there isn't a way to just a pass a raw query to the CursorLoader constructor.

That is because CursorLoader works with content providers, and content providers do not support rawQuery().

so if anybody can point me to a simple way to run a raw query with a CursorLoader class I would appreciate it.

That is impossible, sorry. You are welcome to create your own AsyncTaskLoader that hits a SQLite database and supports rawQuery(). In fact, I will probably write one of these later this year, if I don't see where anyone has beaten me to it.

阅读全文

相关推荐

最新文章