Pass variable to a different activity

Description

User has deleted their subject information Flashcards on Pass variable to a different activity, created by Deleted user on 13/11/2016.
Deleted user
Flashcards by Deleted user, updated more than 1 year ago More Less
Jason Manns
Created by Jason Manns almost 8 years ago
Jason Manns
Copied by Jason Manns almost 8 years ago
1
0

Resource summary

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()
Show full summary Hide full summary

Similar

Spanish Questions
Niat Habtemariam
Reasons Why Development May Not Follow The Expected Pattern
jessica.godfrey
OCR AS Biology - Lipids
Chris Osmundse
unit 1 f321 chemistry ocr
methmip
Cold War in Asia- Philippines, China and Korea
hannah_
Unit 1: Business Studies GCSE
Libby Rose
GCSE Chemistry C4 (OCR)
Usman Rauf
Business Management Exam Review Quiz
emily_hill
Leaving Cert Poetry 2017
Mark O'M
GENERAL PRACTICE-1
Luis Felipe Chávez Choque
New PSBD Question
gems rai