title: Kotlin, Intent: None of the following functions can be called with the arguments supplied
body: <p><strong>Intent doesn't work with RestApiService callback.</strong></p>
  <p>Previously It worked in RegisterActivity:</p>
  <pre><code>fun alert(text: String) {
      val intent = Intent(this, PopUp::class.java)
      intent.putExtra(&quot;text&quot;, text)
      startActivity(intent)
  }
  </code></pre>
  <p>I want to display the result as a pop-up message. <code>PopUp</code> is a custom activity view.</p>
  <p>When I place it into another class, there is an error:</p>
  <blockquote>
  <p>None of the following functions can be called with the arguments</p>
  </blockquote>
  <blockquote>
  <p>supplied. (Context!, Class&lt;*&gt;!) defined in</p>
  </blockquote>
  <blockquote>
  <p>android.content.Intent (String!, Uri!) defined in</p>
  </blockquote>
  <blockquote>
  <p>android.content.Intent</p>
  </blockquote>
  <pre><code>import android.content.Intent
  import androidx.core.content.ContextCompat.startActivity
  import retrofit2.Call
  import retrofit2.Callback
  import retrofit2.Response
  
  class RestApiService {
  
  // MY CUSTOM INTENT! WORKED BEFORE IF TO PLACE INTO AN ACTIVITY.
  fun alert(text: String) {
      val intent = Intent(this, PopUp::class.java)
      intent.putExtra(&quot;text&quot;, text)
      startActivity(intent)
  }
  
  fun addUser(userData: ModelUserRegister, onResult: (ModelUserRegister?) -&gt; Unit){
      val retrofit = ServiceBuilder.buildService(RestApi::class.java)
      retrofit.addUser(userData).enqueue(
  
          object : Callback&lt;ModelUserRegister&gt; {
  
              override fun onFailure(call: Call&lt;ModelUserRegister&gt;, t: Throwable) {
                  onResult(null)
              }
  
              override fun onResponse(call: Call&lt;ModelUserRegister&gt;, response: Response&lt;ModelUserRegister&gt;) {
                  val addedUser = response.body()
                  if (response.code() in 200..320)
                  {
                      alert(response.message())
                  } else {
                      alert(response.message())
                  }
                  onResult(addedUser)
              }
          }
      )
  }
  }
  </code></pre>
  <p>The latest research gave me the advice to change:</p>
  <pre><code>val intent = Intent(this, PopUp::class.java)
  </code></pre>
  <p>to:</p>
  <pre><code>val intent = Intent(RegisterActivity.this, PopUp::class.java)
  </code></pre>
  <p>Didn't help. This question for those people who want to use <strong>Kotlin</strong>!</p>