hey there , how do you access any type inside your...
# android
k
hey there , how do you access any type inside your adapter eg:
val list:Any
then how do i access the value of
Any
e
Do you know that type it will be?
k
@edwardwongtl it can be an object or a list
e
If you know what type it will be at runtime, you can just check the type and do casting to access those values.
k
@edwardwongtl look the type changes ....
object.png
as an object it this
Then this a list
in the same response ... i get flight as type Any
e
That’s why I said you need a check before doing the casting
k
not sure getting what u r meaning .. if(list is object ) else is an array ... do u mean so ?
e
Yes
k
i tried that ...no success
e
Any code to show?
k
give me a minute will show u a snip ..
i have send you what am doing
but not workng