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 about 8 years ago
Jason Manns
Copied by Jason Manns about 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

ExamTime's Getting Started Guide
PatrickNoonan
P2 Radioactivity and Stars
dfreeman
French Tense Endings
James Hoyle
GCSE Biology 4 OCR - The Processes of Life
blairzy123
Physics P2
Phoebe Drew
PSBD TEST 2-2
Suleman Shah
GCSE Maths: Statistics & Probability
Andrea Leyden
Pathos in Battle
mouldybiscuit
Junior Cert Physics formulas
Sarah Egan
Cloud Data Integration Specialist Certification
James McLean
General Pathoanatomy Final MCQs (301-400)- 3rd Year- PMU
Med Student