我如何得到我的内容提供商_count? [英] How do I get the _count in my content provider?

查看:155
本文介绍了我如何得到我的内容提供商_count?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该怎么做让我的内容提供商与记录计数返回_count列?该文件说,这是自动的,但也许它只是采取一些内置的内容提供商。运行数据库查询,似乎不回了。

What should I do to get my content provider to return the _count column with the count of records? The documentation says it is automatic, but maybe it's only taking about some built-in content provider. Running a query to the database seems not to return it.

推荐答案

如果您使用的是 ContentProvider.query() A 光标返回。呼叫 Cursor.getCount()来获取记录的计数在返回的光标。

If you are using ContentProvider.query() a Cursor is returned. Call Cursor.getCount() to get a count of records in the returned cursor.

这篇关于我如何得到我的内容提供商_count?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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