lateinit keyword is used for late initialization of variables.
-->Var is used for creating variable
-->binding is a variable name
-->What is the meaning of this (: ActivityMainBinding) Some people said that is class and some said that created an object, I am too confused.
-->Again write the variable name binding and initialize the ActivityMainBinding.inflate(layoutInflater) -->What is the meaning of these keywords ActivityMainBinding.inflate(layoutInflater)-->Last Question is what is the meaning of this setContentView(binding.root)
lateinit var binding: ActivityMainBinding
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
So binding is used to bind your views.
lateinit var binding :ActivityMainBinding ->here :ActivityMainBinding is a generated class which contains layout ids etc.
binding = ActivityMainBinding.inflate(layoutInflater) -> here we are inflating layout.
setContentView(binding.root)-> here we are setting our layout with class when class runs.Means here we are setting what we see when this activity runs.