|
Created by Jason Manns
almost 8 years ago
|
|
|
Copied by Jason Manns
almost 8 years ago
|
|
Question | Answer |
Write the code to pass a username from one activity to another & display it in a toast. | // sender Intent intent = new Intent(this, OtherActivity.class); intent.putExtra("username", "Bob"); startActivity(intent); // receiver String username = getIntent().getExtraString("username"); Toast.makeText(this, username, Toast.LENGTH_SHORT).show() |
Want to create your own Flashcards for free with GoConqr? Learn more.