title: Get null from intent extra
body: <p>I am trying to pass a string from one activity to another. I do not seem to be able to get the extra form the intent. Where am I going wrong?</p>
  
  <p>Here is the code</p>
  
  <p>To put the extra into the intent:</p>
  
  <pre><code>public void onClick(View v) {
      // TODO Auto-generated method stub
      String string = editTextFeild.getText().toString();
      Intent i = new Intent("com.com.com.otherclass");
      i.putExtra("dat", string);
      startActivity(new Intent("com.com.com.otherclass"));
  }
  </code></pre>
  
  <p>To get the data from the intent (in the com.com.com.otherclass) :</p>
  
  <pre><code>Bundle bundle = getIntent().getExtras();
  if (bundle != null){
      String string = bundle.getString("dat");
      textView.setText(string);
  }
  </code></pre>
  
  <p>p.s. These are not the actual names I use in the code :)</p>
  
  <p>Thanks in advance :)</p>