GoogleApiClient onConnected never called on Wearable device

前端 未结 3 613
逝去的感伤
逝去的感伤 2020-12-16 09:13

I have a wearable device that I\'m trying to connect to the GoogleApiClient but the callbacks are never called (onConnected, onConnectionSuspended or onConnectionFailed). Ev

3条回答
  •  粉色の甜心
    2020-12-16 10:04

    You can call the connect and disconnect manually in the onStart and onStop lifecycle methods, or you can use the enableAutoManage feature.

    mCredentialsApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .enableAutoManage(this, this)
                .addApi(Auth.CREDENTIALS_API)
                .build();
    

提交回复
热议问题