Next, I have a problem reading a data from the database, using the following method:
ButIhavethislittleproblemonline68.WhereareyoutalkingaboutexpectingavalueoftypeTipo()
andI'mpassingString
,onlywhenIputreferencingmyTipo()
classlikethis:
t.type=result.getString(result.getColumnIndex(COL_TIPO))Type
Hedoesnotacceptit.
Thisismyclasstype:
enumclassTipo{RECEITA{overridefuntoString():String{return"RECEITA"
}
},
DESPESA
{
override fun toString(): String
{
return "DESPESA"
}
}
}
If someone has an idea, or a better method to read.
This is my Transaction model in which I have my attributes:
class Transacao(var valor: BigDecimal,
var categoria: String = "Indefinida",
var tipo: Tipo,
var data: Calendar = Calendar.getInstance()) {
}