java android sqlite获取结果计数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java android sqlite获取结果计数相关的知识,希望对你有一定的参考价值。

getContactsCount()
// Getting contacts Count
    public int getContactsCount() {
        String countQuery = "SELECT  * FROM " + TABLE_CONTACTS;
        SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(countQuery, null);
        cursor.close();
 
        // return count
        return cursor.getCount();
    }

以上是关于java android sqlite获取结果计数的主要内容,如果未能解决你的问题,请参考以下文章

viewContext 未保存在数据库中(app.sqlite)

在 Android 上用 Java 获取 SQLite SUM

相同的 Pandas 和 SQLite 查询没有给出相同的结果

Sqlite - 如果有相同的号码,如何查询呼叫日志继续获取单个记录只有连续记录计数?

如何在json android中返回多行并将其传递给sqlite

在 Android 中从 sqlite 创建 Json