I have a class MainActivity.java
associated with a layout activity_main.xml
. In this layout I have a TextView
whose id is "textView". I have a second Activity called SecondActivity.java
and in this Activity I have a Button
. When I click the button, I want to set the text of the TextView
in the MainActivity
. How can I do this ? The simple:
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText("Some Text");
doesn't seem to work...