0

I am calling :

 GoogleApiClient client = new GoogleApiClient.Builder(this.context)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
  client.connect();

inside a UI thread and onConnected(Bundle bundle) is not called.

What am I doing wrong ?

Saar peer
  • 817
  • 6
  • 21

1 Answers1

0

@Saar peer, You could try another workaround. Use a Service which implements GoogleApiClientand it's ConnectionCallbacks. Inside onStart (or onStartCommand) of Service, connect googleApiClient.

GoogleApiClient client = new GoogleApiClient.Builder(ServiceName.class)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
  client.connect();
Rakesh
  • 1,205
  • 1
  • 14
  • 33