title: back to previous activity with intent error
body: <p>I have two activity, on second activity, when  I press enter it will get some value and bring back to first activity.</p>
  
  <p>This is my code:</p>
  
  <p><strong>second activity</strong></p>
  
  <pre><code>//event on "ENTER" button
  Intent i = new Intent();
  i.putExtra("namaDokter", "kosong");
  i.putExtra("idDokter", "kosong");
  setResult(RESULT_OK, i);
  finish();
  </code></pre>
  
  <p><strong>get its value on first activity</strong></p>
  
  <pre><code>public void onActivityResult(int requestCode,int resultCode, Intent data)
  {
      namaDokter=data.getStringExtra("namaDokter");
      idDokter=data.getStringExtra("idDokter");
  }
  </code></pre>
  
  <p>but if I don't press "ENTER" button and only press back button from hardware(or Esc key on my keyboard when I'm using emulator), my app crash, I think it's because I don't get any value from <code>data.getStringExtra("namaDokter");</code></p>
  
  <p>what should I do?</p>