title: Create an AlertDialog in a fragment using Kotlin
body: <p>In my Android app, I have an observer and in the callback I want to display an AlertDialog. The Builder method however needs a context. I need to obtain the context of the activity that the fragment is in but am not sure how to get it:</p>
  
  <pre><code>viewModel.onError.observe(this, Observer {
      val mAlertDialog = AlertDialog.Builder(activity) // This needs the activity's context
      mAlertDialog.setMessage(it.toString())
      mAlertDialog.show()
  })
  </code></pre>