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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -