I'm trying to pass the data from Sign up activity to Profile activity! I wanna pass the username and the birthday. I've tried to use the intent but for some reason that didn't work.
Asked
Active
Viewed 108 times
-1
-
4Possible duplicate of [Passing data between activities in Android](https://stackoverflow.com/questions/2965109/passing-data-between-activities-in-android) – Reaz Murshed Sep 07 '17 at 04:34
2 Answers
1
in your signup activity:
Intent intent = new Intent(this, ProfileActivity.class);
intent.putExtra("username",username);
intent.putExtra("birthday",birthdate);
startActivity(intent):
in your Profile Activity onCreate method:
Intent intent = getIntent();
String username = intent.getStringExtra("username");
String birthday = intent.getStringExtra("birthday");
I would kindly suggest you to make a search next time, before you post :) The question you asked is asked many times:)

Orcun
- 650
- 1
- 7
- 16
-
-
After getting those variables, you should setText() to your TextViews in Profile Activity – Orcun Sep 07 '17 at 19:47
-