title: intent not working when swiching from one activity to another
body: <p>I have made a simple android program with two activities,in that 1st activity contains an edittext and a button,and second activity contain a textview.Now when the button in 1st activity pressed the text from Edittext should go to 2nd activity's textView.I have tried code as below,but it's not working:</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package com.example.myweb;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  
  public class MainActivity extends Activity {
       public final static String EXTRA_MESSAGE = "com.example.myweb";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          Button b =(Button)findViewById(R.id.button1);
          b.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
  
                   EditText ed = (EditText)findViewById(R.id.edit_msg);
                  Intent i = new Intent(getApplicationContext(),Act2.class);
              String s= ed.getText().toString();
  
              i.putExtra("EXTRA_MESSAGE", s);
                  startActivity(i);
  
              }
          });
  
      }
  
  }
  </code></pre>
  
  <p><strong>Act2.java</strong></p>
  
  <pre><code>package com.example.myweb;
  
  import org.w3c.dom.Text;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class Act2 extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.act2);
          Button b1=(Button)findViewById(R.id.button1);
          b1.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
              TextView tv = (TextView)findViewById(R.id.tv1); 
                  Intent i =getIntent();
                  String msg = i.getStringExtra(MainActivity.EXTRA_MESSAGE);
              tv.setText(msg);
  
              setContentView(tv);
  
  
  
  
  
              }
          });
      }
  }
  </code></pre>
  
  <p>please help me.thank you</p>