@Override public void onStart() { super.onStart(); Intent intent = new Intent(this.getActivity(), UserServiceProxy_.class); this.getActivity().bindService(intent, this.serviceConnection, Context.BIND_AUTO_CREATE); this.googleApiClient.connect(); }
@Override public void onStop() { super.onStop(); if (this.bound) { this.getActivity().unbindService(this.serviceConnection); this.bound = false; } this.googleApiClient.disconnect(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.googleApiClient = new GoogleApiClient.Builder(this.getActivity()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(Plus.SCOPE_PLUS_LOGIN) .build(); }