Reputation: 3
So this isn't really a issue, I am just curious, do I really have to null check every time I use view binding? I find it a bit annoying having to put the question mark every time (binding?.[layout item]).
Can somebody please give me a solution to this if it's possible?
Upvotes: 0
Views: 91
Reputation: 4332
The only reason you would be doing this is if you had marked the Binding
object as nullable, e.g. lateinit var binding MainActivityBinding?
. Which there is no need for.
Upvotes: 0