从数据库的Andr​​oid / SQLite的GET布尔布尔、数据库、Andr、oid

2023-09-05 05:27:17 作者:爷的心你不懂丶

只是在想,我怎么能获得在Android的SQLite数据库的布尔字段的值?

was just wondering, how can I obtain the value of a boolean field in a sqlite database in 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;