-3

i.e when the user enters his/her phone number ,the next activity should say : WE HAVE SENT AN OTP TO YOUR NUMBER ( WHERE INSTEAD OF NUMBER , IT SHOULD DISPLAY THE PHONE NUMBER ENTERED BY USER ) FOR MY ANDROID APP

  • Does this answer your question? [How do I pass data between Activities in Android application?](https://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application) – AgentP Jun 07 '20 at 16:48
  • Hi Ayush! Welcome to StackOverflow! Your question is a little hard to understand without more context. Would you mind editing your question to add more detail on what you've already tried to do and what specific problems you're running into? – Sam Spencer Jun 07 '20 at 17:25

1 Answers1

1

open a new activity and send data through intent like this in your first activity :

val intent = Intent(context, MySecondActivity::class.java)
            intent.putExtra("phoneNumber", myPhoneNumber)
            context.startActivity(intent)

then in your second activity in onCreate():

phoneNumber = intent.extras?.getParcelable("phoneNumber")
Bita Mirshafiee
  • 600
  • 8
  • 14