title: null pointer exception on addmarker and markeroptions on googleMap
body: <p>I get nullpointerException when trying to load google map on our app as below.also The java class extends from <code>AppCompatActivty</code>and inside <code>intialiseMap()</code> we try to <code>getMap()</code></p>
  
  <pre><code>D/Profileactivity: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.model.Marker com.google.android.gms.maps.GoogleMap.addMarker(com.google.android.gms.maps.model.MarkerOptions)' on a null object reference
  </code></pre>
  
  <p>And here is where we get the exception,inside placeMarker method</p>
  
  <pre><code>public void placeMarker(LatLongDetails user_latlongobj2,
                          final Context contextPlace) {
      try {
          if (googlemap == null) {
              intialiseMap();
              animatecamera(user_latlongobj);
          }
          if (LoginDetails.Address.length() &lt; 1) {
              LoginDetails.Address = "Getting your location .....";
          }
          //googlemap.clear();
          marker = new MarkerOptions().position(
                  new LatLng(user_latlongobj2.user_latitude,
                          user_latlongobj2.user_longitude)).title(
                  LoginDetails.Address);
  
          System.out.println("This is the Address" + LoginDetails.Address);
  
          marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker));
  
          if (googlemap != null) {
  
              googlemap.addMarker(marker).showInfoWindow();
          }else {
              intialiseMap();
              googlemap.addMarker(marker).showInfoWindow();
          }
          System.out.println("PLACING MARKER" + LoginDetails.Address);
          if (marker == null || contextPlace == null) {
              Intent in =new Intent(this,ProfileActivity1.class);
              in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              startActivity(in);
          }
          else
              fixmarker(marker, contextPlace);
  
      } catch (Exception e) {
          fixmarker(marker, contextPlace);
          Log.d("Profileactivity", "" + e);
      }
  
  }
  </code></pre>
  
  <p>This is how we initialise Map</p>
  
  <pre><code>private void intialiseMap() {
  
  try {
  if (dialog == null)
      dialog = ProgressDialog.show(ProfileActivity1.this, "",
              getString(R.string.getting_location), true, true);
  }catch(Exception e) {
  Log.e("eybaba",""+e);
  }
      try {
          if (googlemap == null) {
              googlemap = ((MapFragment) getFragmentManager()
                      .findFragmentById(R.id.mapfragment)).getMap();
              googlemap.setInfoWindowAdapter(new CustomInfowindow(context));
              // check if map is created successfully or not
              if (googlemap == null) {
                  Toast.makeText(getApplicationContext(),
                          R.string.maps_create_error, Toast.LENGTH_SHORT)
                          .show();
              }
          }
      } catch (Exception e) {
      }
  }
  </code></pre>