public int getCount() { SQLiteDatabase db = dbOpenHelper.getReadableDatabase(); Cursor cursor = db.rawQuery("select count(id) from table",null); cursor.moveToFirst(); Long count = cursor.getInt(0); cursor.close(); return count; }
时间: 2024-12-16 05:07:34