title: Android back button in a Map activity results in a crash
body: <p>I tried to add a back button in my Map activity but it always crashes that is my code for the action bar</p>
  
  <pre><code>    ActionBar actionBar;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_mapsanlocations);
  
      // Obtain the SupportMapFragment and get notified when the map is ready to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
              .findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
     geocoder = new Geocoder(this, Locale.getDefault());
      actionBar = getActionBar();
      actionBar.setHomeButtonEnabled(true);
  
  
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
          case android.R.id.home:
  
              this.finish();
              return true;
          default:
              return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>and I also included its parent in the android mainfest</p>
  
  <blockquote>
  <pre><code>    &lt;activity
          android:name=".Mapsanlocations"
          android:parentActivityName=".MainActivity"
          android:label="@string/title_activity_mapsanlocations"&gt;&lt;/activity&gt;
  </code></pre>
    
    <p>Thanks in advance.</p>
  </blockquote>