Answer the question
In order to leave comments, you need to log in
How to find the length of a SQLite android table?
I want to implement a start window where I will set a password if there are no rows in the table. Otherwise, launch another activity. How to get the length of a table or check if a row exists in a table.
Answer the question
In order to leave comments, you need to log in
long rowCount = DatabaseUtils.queryNumEntries(db, TABLE_NAME);
long rowCount = DatabaseUtils.longForQuery(db, "SELECT COUNT(*) FROM table_name", null);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question