title: How to properly "setMutableVisiblity"?
body: <p>I'm trying to create a function, <code>setMutableVisibility</code>. The thing is that I'm supposed to use another function but I got an error. I do not understand why. Furthermore one of my friend just did the same function on his computer but he didn't get the error... </p>
  
  <pre><code>@BindingAdapter("mutableVisibility")
  fun setMutableVisibility(view: View, visibility: MutableLiveData&lt;Int&gt;?) {
      val parentActivity: AppCompatActivity? = view.getParentActivity()
      if(parentActivity != null &amp;&amp; visibility != null) {
          visibility.observe(parentActivity, Observer{ value -&gt; view.visibility = value?:View.VISIBLE})
      }
  }
  </code></pre>
  
  <p>AS* is telling me that "parentActivity" is the wrong type, I think it's not the case.
  But here the advice from AS : </p>
  
  <blockquote>
    <p>Type mismatch.
    Required: LifecycleOwner
    Found: AppCompatActivity?</p>
  </blockquote>
  
  <p>Thank you for your answers.</p>
  
  <p>*AS: Android Studio</p>