how to get current location in google map android

前端 未结 17 1994
长发绾君心
长发绾君心 2020-11-27 14:04

Actually my problem is I am not getting current location latitude and longitude I tried so many ways.I know that this question already asked in SO I tried that answers also

17条回答
  •  时光说笑
    2020-11-27 14:46

    I think that better way now is:

    Location currentLocation = LocationServices.FusedLocationApi.getLastLocation(googleApiClient);
    

    Documentation. Getting the Last Known Location

提交回复
热议问题