title: Android getIntent() Nullpointer Exception
body: <p>In my MainActivity I've got a ListView and a OnClickListenter. Via Button it is possible to change to another site(addRecord.xml), which is adding a new record in the database (and ListView).</p>
  
  <p>When clicking (and holding) on a item, you get to the same site as when adding a new record. (see above).
  Everything until here works fine.
  Now I tried to add a new Intent because the EditTexts in the  (addRecord.xml) should be filled with the data of the Item of the ListView which is clicked(longclick).</p>
  
  <pre><code>Intent i = new Intent(getApplicationContext(),ActivityAddRecord.class);
                      i.putExtra("Name",  arrayList.get(position).getName());
                      i.putExtra("update", true);
                      startActivity(i);
  </code></pre>
  
  <p>in the ActivityAddRecord class I've added:</p>
  
  <pre><code>  Intent i = getIntent();
         final boolean update = i.getExtras().getBoolean("update");
         if(update==true)
         {
             editText1.setText(getIntent().getExtras().getString("Name"));  
         }
  </code></pre>
  
  <p>Now when clicking and holding on a ListView item you get to the addrecord.xml site and the EditText is filled with the Name. It works fine.</p>
  
  <p>But when I want to add a new Record (via Button click) the App crashes. Without these 6 lines of code it's not crashing.</p>
  
  <p>In LogCat it shows NullPointerException at Line 52 which is</p>
  
  <pre><code>final boolean update = i.getExtras().getBoolean("update");
  </code></pre>
  
  <p>I've read a lot of topics about this kind of error, but the soulutions didn't help me</p>
  
  <p>any ideas?</p>