Get the field value with a Cursor

I think you can forget about checking for null.

Instead check if there is data and then access the columns using the cursor:

Cursor cursor = fetchOption(0);

if (cursor.moveToFirst()) // data?

cursor.close(); // that's important too, otherwise you're gonna leak cursors

It might also make sense to read an Android tutorial. The notepad tutorial seems to fit the bill:

Leave a Comment