title: Boolean condition is not executing in kotlin
body: <p>I have code in which I am doing database operation using Room database. I want to change the Icon if the user favourite an item and if user tap on the same icon it changes to an other icon.I am able to set the favourite icon but when user tap on the icon again it doesn't change. Here is my code</p>
  <pre><code>var isfavorite by Delegates.notNull&lt;Boolean&gt;()
  
  OncreateView(){
  isfavorite=false
  
  }
  
  add_fav.setOnClickListener {
           if(!isfavorite) {
               add_fav.setImageResource(R.drawable.star)
               favoriteViewModel.InsertData(
                   requireContext(),
                   edit_text_fiele.text.toString(),
                   translated_textview.text.toString()
               )
  
               isfavorite=true
  
           }
           if(isfavorite){
               add_fav.setImageResource(R.drawable.favorites)
           }
       }
  </code></pre>