Code example for LocationClient

Methods: disconnect, isConnected

0
    mLocationClient.connect();
    return false; 
  } 
 
  private void disconnect() { 
    if (mLocationClient != null && mLocationClient.isConnected()) {
      Logger.i(this, "will disconnect");
      mLocationClient.disconnect();
    } 
  } 
 
  private void showLocation() { 
    mLastLocation = mLocationClient.getLastLocation();
    if (mLastLocation != null) {
      Logger.d(this, "Location: " + mLastLocation.toString());
      Toast.makeText(mActivity, "Location: " + mLastLocation,
          Toast.LENGTH_SHORT).show();
    } else { 
      Toast.makeText(mActivity, mActivity.getString(R.string.msg_no_location),
          Toast.LENGTH_SHORT).show();
    }