Android Studio My name is not displaying in second activity after passing through first Activity
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
Android Studio My name is not displaying in second activity after passing through first Activity
4
Answers
In your Main Activity:
Please call intent.putExtra(), before startActivity(). Example:
And fetch like that (in Main Activity 2)
I noticed that in the ‘MainActivity.java‘ you are starting new activity before passing the string into the intent,
just switch the both lines 30 and 31.
In your MainActivity, you should putExtra before startActivity. Like this:
In your MainActivity, create a new Intent:
Then in the MainActivity2, retrieve those values: