title: Null Pointer Exception on get Map
body: <p>I'm implementing the Google Map V2 api, and getting the current location. I have used exactly the same code as the Google sample project, </p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_add_map);
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      setUpMapIfNeeded();
      setUpLocationClientIfNeeded();
      mLocationClient.connect();
  }
  
  @Override
  public void onPause() {
      super.onPause();
      if (mLocationClient != null) {
          mLocationClient.disconnect();
      }
  }
  
  private void setUpMapIfNeeded() {
      // Do a null check to confirm that we have not already instantiated the map.
      if (mMap == null) {
          // Try to obtain the map from the SupportMapFragment.
          mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map_AddFragment))
                  .getMap();
          // Check if we were successful in obtaining the map.
          if (mMap != null) {
              mMap.setMyLocationEnabled(true);
              mMap.setOnMyLocationButtonClickListener(this);
          }
      }
  }
  </code></pre>
  
  <p>My Layout : </p>
  
  <pre><code>&lt;RelativeLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"        
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:map="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;fragment 
      android:id="@+id/map_AddFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:name="com.google.android.gms.maps.MapFragment"
      tools:ignore="MissingPrefix" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>when I run this code from the sample project it works, but when I copy this code to my project, it gives me a <code>Null pointer exception</code> on the line <code>mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map_AddHTag))
                  .getMap();</code> </p>
  
  <p>I don't really know what's going on since It was working good, and still works just well in the sample project.</p>
  
  <p>Thank you.</p>