title: How can I detect pogrammatically whether a Google Map was actually loaded on Android with API v2 (e.g. when network is not available)?
body: <p>I have the Google Map API v2 working fine on Android using a SupportMapFragment in a FragmentActivity. </p>
  
  <p>However, when there is no network connection (and no cached information), obviously, no map can be shown. LogCat gives me an error message confirming this ("Google Maps Android API: Failed to load map. Could not connect to Google servers"), but this is not thrown.</p>
  
  <p>How can I detect this case programmatically, because I would like to forward to a different Activity in this case? The docs claim that if no map could be loaded getMap() called on the SupportMapFragment would return null, but this does not seem to be the case.</p>
  
  <p>I've been searching around for almost two days for a solution, but was not able to find anything. Am I totally overlooking something or is it really not possible to find out whether something was actualy loaded? Any help is greatly appreciated.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here is my current code, the error message appears on the logs after the setContentView is executed (checked with debugger), but it still says that ConnectionResult == SUCESS.</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_main);
  
      SupportMapFragment smf = ((SupportMapFragment) 
      getSupportFragmentManager().findFragmentById(R.id.map));
      map = smf.getMap();
  
      if (map != null &amp;&amp; GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == 
                                          ConnectionResult.SUCCESS) {
          // doSomething with the map
      } else {
          Toast.makeText(this, "Google Maps not working", Toast.LENGTH_SHORT).show();
          System.out.println(GooglePlayServicesUtil.isGooglePlayServicesAvailable(this));
          // forward to another activity
      }
  }
  </code></pre>