Exemplo n.º 1
0
  @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();
  }
Exemplo n.º 2
0
  @Override
  public void onStop() {
    super.onStop();

    if (this.bound) {
      this.getActivity().unbindService(this.serviceConnection);
      this.bound = false;
    }

    this.googleApiClient.disconnect();
  }
Exemplo n.º 3
0
  @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();
  }