I’m trying to return a field name from a record using cursor. Does the statement as follows returns all the records of a table?
Cursor u = db.query(t1, new String[] { "id","titlee","date", "tme", "detail","selcal","partmail","stat","prior" },null, null, null, null, null);
Any help is highly appreciated.
As you have no WHERE clause, all rows will be returned. Each item of the cursor will contain exactly those fields you list in the array (assuming those columns exist in the table). However, if you are only interested in one field (you say “a field name”) then you’d be better including only that column id in the query. So, assuming you only really care about the column “titlee”, then your query could be:
Cursor u = db.query(t1, new String[] { "titlee" }, null, null, null, null, null);