Intent Kotlin receiving null value

Asked

Viewed 35 times

0

I have the following Intent of an Activity:

val intent = Intent(this, FormCadastroUsuario::class.java)
        intent.putExtra("email", email)
        startActivity(intent)

And to receive in another Activity, I have the following code:

val email = intent.getStringExtra("email").toString()

However, this variable is always "coming" with the null value. What can I do to receive with the correct value of the original Activity?

  • 1

    Where does that come from intent which you used in the second excerpt of code? Could you put a little more context?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.