Skip to content

Instantly share code, notes, and snippets.

@aldakur
Last active June 13, 2016 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldakur/8d584d19cf7e0e1ede99de1ab0789476 to your computer and use it in GitHub Desktop.
Save aldakur/8d584d19cf7e0e1ede99de1ab0789476 to your computer and use it in GitHub Desktop.
#android Transfer data between activities
//First activity (ActivityA). The data is in editText (et1)
Intent i = new Intent(this, ActivityB.class);
i.putExtra("textByUser", et1.getText().toString());
startActivity(i);
//Second activity (ActivityB). Get data
Bundle bundle = getIntent().getExtras();
String data = bundle.getString("textByUser");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment