title: Change the Text of a Textview with Edittext?
body: <p>Hey how can I do it in Android Studio?</p>
  
  <p>I want to type something in an Edittext ( which it located in an Activity extends AppCompatActivity), and if I click on save, this text will be shown on another Textview (which is located in another class extends Fragments)?</p>
  
  <p><strong>AccountActivity.java:</strong></p>
  
  <pre><code> @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_account);
  
  final EditText editText = (EditText) findViewById(R.id.usernameedittext);
  TextView save = (TextView) findViewById(R.id.profile_save);
  
  save.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          Intent intent = new Intent(AccountActivity.this, ProfileFragment.class);
          intent.putExtra("name", editText.getText().toString());
          startActivity(intent);
      }
  });
  </code></pre>
  
  <p><strong>ProfileFragment.java:</strong></p>
  
  <pre><code>@Nullable
  @Override
  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      View view = inflater.inflate(R.layout.fragment_profile, container, false);
  
  
      final TextView username = (TextView) view.findViewById(R.id.profile_username);
  
      username.setText(getActivity().getIntent().getExtras().getString("name")) }
  </code></pre>