simple hit counter web log free

Android Studio – Intents to switch activities and pass data between them!

ideZain.com android-studio-intents-to-switch-activities-and-pass-data-between-them-youtube-thumbnail-475x356 Android Studio - Intents to switch activities and pass data between them! Android Programing  switch studio new intent getIntent extras empty bundle android activity

Video on how to use Intents to switch activities and pass data between them

Code:-
1) Sending page
Intent i = new Intent(this,Main2Activity.class);
i.putExtra(“Username”, “andromin”);
i.putExtra(“Password”,”XYZ”);
startActivity(i);

2) Receiving page
Bundle extras = getIntent().getExtras();
String name_passed = extras.get(“Username”).toString();
String pw_passed = extras.get(“Password”).toString();

ideZain.com android-studio-intents-to-switch-activities-and-pass-data-between-them Android Studio - Intents to switch activities and pass data between them! Android Programing  switch studio new intent getIntent extras empty bundle android activity

You May Also Like

About the Author: admin

Leave a Reply

%d bloggers like this: