title: How can I pass a string from a class to another class
body: <p>How can I pass a <code>string</code> from a public class to <code>TextView</code> of other class in Java (android)?</p>
  
  <p>ClassA.java:</p>
  
  <pre><code>hereButton updateButton = (Button)findViewById(R.id.updateButton);
  updateButton.setOnClickListener(new OnClickListener(){
      @Override
      public void onClick(View v) {
          String text = inputText.getText().toString();   
          outputText.setText(text);
      }
  });
  </code></pre>
  
  <p>ClassB.java:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.new_game);
  }
  </code></pre>