问题描述
如何在 Android 上的 SQLite 数据库中获取布尔字段的值?
How can I obtain the value of a boolean field in an SQLite database on Android?
我一般使用getString()、getInt()等来获取我的字段的值,但是好像没有getBoolean() 方法.
I usually use getString(), getInt(), etc. to get the values of my fields, but there does not seem to be a getBoolean() method.
推荐答案
是:
boolean value = cursor.getInt(boolean_column_index) > 0;