title: Why ViewBinding doesn't recognize toolbar?
body: <p>Recently I found out that android kotlin extension has been deprecated.
  Now I am using the <code>viewBinding</code>.</p>
  <p>with android Kotlin extension. I get no problem with the code below</p>
  <pre><code>class DetailsActivity : AppCompatActivity() {
     override fun onCreate(savedInstanceState:android.os.Bundle?) {  
      super.onCreate(savedInstanceState) 
      setContentView(R.layout.activity_details)  
      setupToolbar()
  }  
  
  private fun setupToolbar() { 
     setSupportActionBar(toolbar)  
    }
  }
  </code></pre>
  <p>However with <code>ViewBinding</code> as shown below, I get <code>unresolved reference error: toolbar</code></p>
  <pre><code>class DetailsActivity : AppCompatActivity() {
      private lateinit var binding:ActivityDetailsBinding
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          binding= ActivityDetailsBinding.inflate(layoutInflater)
          val view=binding.root
          setContentView(view)
          setupToolbar()
      }
  
      private fun setupToolbar() {
          setSupportActionBar(toolbar)
      }
  }
  </code></pre>
  <p>Here is the layout xml.
  <a href="https://i.stack.imgur.com/NG6zD.png" rel="nofollow noreferrer">enter image description here</a></p>