0
Next guys, I’m having a problem reading a data from the database, with the following method:
But I have this little problem on line 68. Where are you saying you expect a value like Tipo()
and I’m passing a String
, only when I place referencing my class Tipo()
thus:
t. type = result.getString(result.getColumnIndex(COL_TIPO)). Type
He doesn’t accept.
This is my kind of class:
enum class Tipo {
RECEITA
{
override fun toString(): String
{
return "RECEITA"
}
},
DESPESA
{
override fun toString(): String
{
return "DESPESA"
}
}
}
If anyone has any ideas, or a better method for reading.
This is my Transacao model in which I have my attributes:
class Transacao(var valor: BigDecimal,
var categoria: String = "Indefinida",
var tipo: Tipo,
var data: Calendar = Calendar.getInstance()) {
}