Here you can find the source of getRowsCount(SQLiteDatabase sqlitedatabase, String s, String s1, String as[])
static long getRowsCount(SQLiteDatabase sqlitedatabase, String s, String s1, String as[])
//package com.java2s; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class Main { static long getRowsCount(SQLiteDatabase sqlitedatabase, String s, String s1, String as[]) { Cursor cursor = null;/*from w w w . ja va 2s. co m*/ try { cursor = sqlitedatabase.query(s, new String[] { "COUNT(*)" }, null, null, null, null, null); if (!cursor.moveToFirst()) return 0L; else return cursor.getLong(0); } finally { if (null != cursor) { cursor.close(); } } } }