如何使用Android google API查找当前位置? 我用了这段代码:
GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, 0 , this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
LocationServices.FusedLocationApi.getLastLocation(googleApiClient);
但这不起作用。怎么了?
答案 0 :(得分:1)
你忘记了这一行:
googleApiClient.addApi(LocationServices.API)