I always see people say that it cursor is never null so you dont need to check for null or not but then there are other people that say that cursor can be null and you chould always check it.
so looking at the query method here it does show that null gets returned so I dont know if I am just missing something or are the people saying that cursor is never null wrong?
do you or do you not need to check if Cursor
is null when a query is made?
For ContentResolver
queries, yes, the returned Cursor
can be null
as illustrated by the code you linked.
For SQLiteDatabase
queries, no, checking for null
Cursor
is not necessary. Though it does not hurt much.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With