title: Kotlin: How to call getSupportFragmentManager() in RecyclerView.Adapter
body: <p>I would like to call the Support Fragment Manager in my RecyclerView.Adapter after the click event in order to move to a different fragment. My approach:</p>
  
  <pre><code>(context as MainActivity).supportFragmentManager
                              .beginTransaction()
                              .replace(MainActivity.FRAGMENT_CONTAINER, TextScreen())
                              .commit()
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>kotlin.TypeCastException: null cannot be cast to non-null type</p>
  </blockquote>
  
  <p>Can you help me?</p>