Code example for LocationClient

Methods: connect

0
 
  @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.