@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); TextView usersNameMessage = (TextView) findViewById(R.id.users_name_message); String nameSentBack = data.getStringExtra("UsersName"); usersNameMessage.append(" " + nameSentBack); }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstaceState); setContentView(R.layout.second_layout); // gets the intent that called the SecondScreen activity. Intent activityThatCalled = getIntent(); // gets the data passed by the previous activity by providing the name. String previousActivity = activityThatCalled.getExtras().getString("nameOfThedataToBePassed"); }
getExtras
getStringExtra
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)