jeudi 27 août 2015

How to fill boolean set-Method with int value

I have a set-Method setSelected() which expect a boolean. SQLite is not able to store boolean values, so I decided to make it as integer, and convert the boolean to int:

values.put(COLUMN_SELECTED, (member.isSelected()) ? 1 : 0 );

This worked already for me. But now I want to set the value again, but how I can pass the int to the method which requires a boolean:

member.setSelected(cursor.getColumnIndex(COLUMN_SELECTED));

ERROR-> setSelection(Boolean) in Member cannot be applied to (int)

Aucun commentaire:

Enregistrer un commentaire