How can I obtain the value of a boolean field in an SQLite database on Android?
I usually use getString(), getInt(), etc. to get the values
getString()
getInt()
boolean datatype is not available in Cursor.
boolean
Cursor
you will get the result in an int, so you need to convert that int value to a boolean.
int
You can either use
boolean b = cursor.getInt(boolean_column_index) > 0;
or
boolean b = (cursor.getInt(boolean_column_index) != 0);