-1
My Pokemonitem class has a Skill List on it (another class), when I get the "abilities" I get a "null" on my screen instead of the "abilities". Someone can help me?
private fun configDetalhes() {
Toast.makeText(activity, pokemon.nome, Toast.LENGTH_LONG).show()
detalhesViewModel.getDetalhes(pokemon.id)
detalhesViewModel.mResponse.observe(viewLifecycleOwner, {
if(it.isSuccessful){
tv_detalhes_nome_pokemon.text = pokemon.nome
tv_detalhes_habilidades_pokemon.text = it.body()?.abilities.toString()
}
})
}
Pokemonitem class
@Entity(tableName = "PokemonItem")
data class PokemonItem(
@PrimaryKey(autoGenerate = false)
val id: String,
@SerializedName("name") val nome: String,
val smallImageUrl: List<PokemonImage>,
val types: List<String>,
val abilities: List<PokemonAbility>
) :Serializable
Pokemonability class
class PokemonAbility(
val name: String,
val text: String
)