Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package com.example.amiel1.multiplieactivities;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.widget.EditText;
  8. import android.widget.TextView;
  9.  
  10. /**
  11. * Created by Amiel on 01/02/2015.
  12. */
  13. public class SecondScreen extends Activity {
  14.  
  15.  
  16. @Override
  17. protected void onCreate(Bundle savedInstanceState) {
  18. super.onCreate(savedInstanceState);
  19.  
  20. setContentView(R.layout.second_layout);
  21. Intent activityThatCalled = getIntent();
  22. String previous = activityThatCalled.getExtras().getString("callingActivity");
  23. TextView callingActivitys = (TextView) findViewById(R.id.namewastv);
  24. callingActivitys.append(previous);
  25. }
  26.  
  27.  
  28. public void onSendUserName(View view) {
  29.  
  30. EditText userNameET = (EditText) findViewById(R.id.edit_text_name);
  31. String nameS = String.valueOf(userNameET.getText());
  32. Intent goBack = new Intent();
  33. goBack.putExtra("getName", nameS);
  34. setResult(RESULT_OK, goBack);
  35. finish();
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement