Google Api Client sometime NULL in onConnected

前端 未结 6 486
小蘑菇
小蘑菇 2021-01-03 23:51

I implement GoogleApiClient as bellow:

 mGoogleApiClient = new GoogleApiClient.Builder(this)
                .enableAutoManage(this, 0 /* client         


        
6条回答
  •  醉酒成梦
    2021-01-04 00:37

    If u are facing this problem when u try to reinitialize mGoogleApiClient, then just remove

    .enableAutoManage(this, 0 /* clientId */, this)

    Use

    mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addApi(LocationServices.API)
                .addApi(Places.GEO_DATA_API)
                .addConnectionCallbacks(this)
                .build();
    

    and it will work fine

提交回复
热议问题