how to fetch the sqlite count in my list view?

view story

http://stackoverflow.com – Is this correct code for counting the task?how to fetch these counting in my listview?// Getting contacts Count public int getTaskCount() { String countQuery = "SELECT Count(KEY_ROWID_REL) FROM " + DATABASE_TABLE_REL; SQLiteDatabase db = this.getReadableDatabase(); Cursor mcursor = db.rawQuery(countQuery, null); mcursor.moveToFirst(); // return count return mcursor.getCount(); } private SQLiteDatabase getReadableDatabase() { // TODO Auto-generated method stub return null; } public long fetchAllProjectscount(int rowId) { String countQuery = "SELECT (HowTos)