title: Change value of a empty textview after a activity starts android
body: <p>I am new to Android. I have a simple app which has two activities, and which runs as follows:</p>
  
  <h3>Activity 1:</h3>
  
  <pre><code>public void SendMessage(View view){
      Intent intent=new Intent(this,DisplayMessage.class);
      EditText editText=(EditText) findViewById(R.id.edit_message);
      String message=editText.getText().toString();
      intent.putExtra(EXTRA_MESSAGE, message);
      startActivity(intent);
  }
  </code></pre>
  
  <h3>Activity 2:</h3>
  
  <p>The "Extra_Message" will displayed at a single <code>TextView</code> and increased by 1 and repeated 10 times each result of the addition will be displayed on the <code>TextView</code> with 1000ms of delay.</p>
  
  <pre><code>Intent intent= getIntent();
  String message=intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
  int no= Integer.parseInt(message);
  TextView textView=new TextView(this);
  textView.setTextSize(40);
  for(int i=0;i&lt;10;i++)
  {
      message=Integer.toString(no);
      textView.setText(message);
      setContentView(textView);
      no++;
  
      try {
          Thread.sleep(1000);
      } catch(InterruptedException e) {
      }
  }
  </code></pre>
  
  <p>Now the problem is that I don't know where should I run this code. It should run after the creation of the second activity.  </p>