title: How do I call the context correctly to start an Activity
body: <p>Since I experienced crashes of this genre:</p>
  
  <blockquote>
    <p>Calling startActivity() from outside of an Activity  context requires
    the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</p>
  </blockquote>
  
  <p>I started wondering of the right usage of the context for a startActivity-Intent.</p>
  
  <p>This was my Kotlin-Code (Activity -> Activity): </p>
  
  <pre><code>btn_scan.setOnClickListener {
              val mIntent = Intent(applicationContext, Scanner::class.java)
              mIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
              mIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
              applicationContext.startActivity(mIntent)    
  
          }
  </code></pre>
  
  <p>which I was able to fix with "this":</p>
  
  <pre><code>btn_scan.setOnClickListener {
              val mIntent = Intent(this, Scanner::class.java)
              mIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
              mIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
              this.startActivity(mIntent)    
  
          }
  </code></pre>
  
  <p>But now I'm a little bit insecure of the right usage of this, since accessing it from a inner-function for example needs this@ActivityName.
  So I'd like to ask you politely to explain me how to know which is the right context, when starting an Activity from an Activity, from a Fragment or from a function or using CoroutineScope</p>
  
  <p>Thank you</p>