askIT

Count (Android SQLite)

Count used to count the number of rows in a table. The method of count programmed into DBadapter, and called on via MainAcitivity.

DBadapter

public int countAllRecordsNotes()
{
        Cursor mCount = db.rawQuery("SELECT COUNT(*) FROM " + databaseTableNotes + "", null);
        mCount.moveToFirst();
        int count= mCount.getInt(0);
        mCount.close();
        return count;
}

Add comment

avatar_blank_60.png

Comment:

Name:

Email:

Comments

No comments yet. You can be the first one to comment. Just write your comment in the form and click on the submit button.