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

Weimar Germany 1919: The Spartacists and the constitution
Chris Clayton
British Empire
chloeeatsalot
KEE2
harrym
Photosynthesis
ecarleton622
Sociology and Social policy
nasreen_946_
C1 B1 & P1 Test
jodie00
Physics Unit 2 - Force, Acceleration And Terminal Velocity
Ryan Storey
Creating a revision planner using Calender
justin@migs
PHR SPHR Labor Union Terminology
Sandra Reed
HEMORRAGIAS - OBST PATOLOGICA
María José Alvarez Gazzano
Mapa Mental para Resumir y Conectar Ideas
Ricardo Padilla Alcantara