title: Android .putExtra (not responding)
body: <p>I need to pass a String created from 'Activity A' to 'Activity B' so that I can display it in a TextView.
  The problem is that the code causes Android to not respond, its identical to the other tutorials online. </p>
  
  <p>Thanks for any feedback.</p>
  
  <p><strong>Activity A.onCreate()</strong></p>
  
  <pre><code>check_button = (Button) findViewById(R.id.check_button);
      check_button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v)
          {
              Intent i = new Intent(AddActivity.this, DetailActivity.class);
              String hash = text_hash.toString();
              i.putExtra("hash" , hash);
              startActivity(i);
          }
      });
  </code></pre>
  
  <p><strong>Activity B.onCreate()</strong></p>
  
  <pre><code>Bundle extras = getIntent().getExtras();
  if (extras != null)
  {
      passedHash = (String) getIntent().getExtras().getString("hash");
      hash.setText(passedHash);
  }
  </code></pre>
  
  <p>stack trace:</p>
  
  <pre><code>     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
  </code></pre>