GoConqr has a new look! Let us know what you think.

Flashcards

Pass variable to a different activity

Deleted user User has deleted their subject information English 1 card

Cards in this deck (1)

  1. 1Write 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()

Information

Description
User has deleted their subject information Flashcards on Pass variable to a different activity, created by Deleted user on 13/11/2016.
Created by
Deleted user · Nov 2016
Updated
Nov 14, 2016
Views
53
History
  • Created by Jason Manns · Nov 11, 2016
  • Copied by Jason Manns · Nov 13, 2016
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?