java - Column Index not finding a column that definitely exists -


try {     cursor c = db.rawquery("select time updatetimes type = 'root'", null);     long time = c.getlong(c.getcolumnindex("time")); } catch (cursorindexoutofboundsexception e) {  } 

this exception gets thrown, though column "time" exists, the same query returns data expected when using sqlite3 client. ideas?

the cursor not @ valid index. need move first:

if (c.movetonext()) {     time = c.getlong(c.getcolumnindex("time")); } 

Comments