How check Android database is empty or not?

Ngoc Hue

New member
How check Android database is empty or not?
Answer
Set up a
query-method (either in your ContentProvider directly) or in another class using your ContentResolver with a projection for one column (ID should do the trick). Then see if the cursor contains anything or not. You can query database with total row count. If it is > 0 then you can run your next code.
 

Tìm kiếm

Back
Top