-1

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.

www
  • 21
  • 8
  • 4
    Possible 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 Answers2

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
0

Try this

This is a very simple question just pass the data to another activity with intent or bundle and get the data from another activity and set in the layouts as you want

Community
  • 1
  • 1
Sunil
  • 3,785
  • 1
  • 32
  • 43