title: Why is GoogleApiClient disconnected when I try to access in OnActivityResult but not elsewhere?
body: <p>When I call in the onActivityResult in a fragment, the GoogleApiClient I have in the parent activity is "not connected". </p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == Constants.REQUEST_PLACE_PICKER) {
  
          if (resultCode == Activity.RESULT_OK) {
              /* User has picked a place, extract data.
                 Data is extracted from the returned intent by retrieving a Place object from
                 the PlacePicker.
               */
              final Place place = PlacePicker.getPlace(data, getActivity());
  
              SharedPreferences prefs = getActivity().getSharedPreferences(Constants.SHARED_PREFS, Context.MODE_MULTI_PROCESS);
              SharedPreferences.Editor editor = prefs.edit();
              editor.putString("address"+id, address.toString()).commit();
              editor.putString("name"+id, name.toString()).commit();
              Log.d(TAG, "Just picked a location, id=" + id);
  
              ((AllinOneActivity getActivity()).addGeofenceFromListposition(id); 
       getActivity()).addGeofencesButtonHandler(); // &lt;-- This code that checks mGoogleCLientApi.connected()
  
  
              mRecyclerView.setAdapter(new LocationListAdapter(getGymLocations(), mListener, this));
          } else {
              Log.d(TAG, "resultCode is wrong " + "resultCode");
  
          }
  
      } else {
          super.onActivityResult(requestCode, resultCode, data);
      }
  }
  </code></pre>
  
  <p>However if I do the same thing in a button in the same fragment class, the thing is connected. </p>
  
  <pre><code>    //in onCreateView
      mFab = (FloatingActionButton) view.findViewById(R.id.fab);
      mFab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              mListener.onListFragmentInteraction(); //&lt;-- Work fine!
  
          }
      });
  </code></pre>
  
  <p>AFAIK this should be calling the same activity, so why is the client disconnected in the first one but not the second?</p>
  
  <pre><code>//In parent Activity
  public void onListFragmentInteraction(){
      addGeofencesButtonHandler();
  }
  public void addGeofencesButtonHandler() {
      Log.d(TAG, "Adding geoFencesButtonHandler click");
      if (!mGoogleApiClient.isConnected()) {
          Toast.makeText(this, "not connected in addgeofence", Toast.LENGTH_SHORT).show();
          return;
      }
  
      try {
          LocationServices.GeofencingApi.addGeofences(
                  mGoogleApiClient,
                  // The GeofenceRequest object.
                  getGeofencingRequest(),
                  // A pending intent that that is reused when calling removeGeofences(). This
                  // pending intent is used to generate an intent when a matched geofence
                  // transition is observed.
                  getGeofencePendingIntent()
          ).setResultCallback(this); // Result processed in onResult().
      } catch (SecurityException securityException) {
          // Catch exception generated if the app does not use ACCESS_FINE_LOCATION permission.
          logSecurityException(securityException);
      }
  }
  
  protected void onStart() {
          super.onStart();
      mGoogleApiClient.connect();
  
  }
  
  protected void onStop() {
      super.onStop();
      mGoogleApiClient.disconnect();
  
  }
  </code></pre>