title: nullpointerexception when use getIntent().getExtras().getString
body: <p>I want to pass a value in a activity to another activity and use this code</p>
  
  <pre><code>            Intent i = new Intent(MainActivity.this,ListActivity.class);
              i.putExtra("position","ایران");
              startActivity(i);
  </code></pre>
  
  <p>and in other activity for return variable use this code</p>
  
  <pre><code>        value = getIntent().getExtras().getString("position");
  </code></pre>
  
  <p>Now when I run the program it gives this error:</p>
  
  <pre><code>java.lang.nullpointerexception
  </code></pre>
  
  <p>Please help me.</p>