leosan
08/24/2018, 10:50 AMprivate val imageResource: Int? by lazy { arguments?.getInt(ARG) }
//Doesn't work compiler complain it is not integer
imageResource?.let { ivIcon.setImageResource(it) }
//Works
imageResource?.run { ivIcon.setImageResource(this) }
is there a way to use the `@DrawableRes`with delegates? or do I have to lose the perk of using setImageResource
?
Edit: It works with run
what am I missing here?Denis A
08/24/2018, 11:16 AMleosan
08/24/2018, 11:18 AMit
is not integer but it works with run