Android - My app can get location information until opening Google Maps although it has related permissions

前端 未结 1 730
萌比男神i
萌比男神i 2020-12-02 02:39

I am new in Android development. So my question may be too basic. Sorry for this. Now I am maintaining a previously written code.

This application use the location s

相关标签:
1条回答
  • 2020-12-02 03:21

    Basically it means that you try to retrieve location via mFusedLocationClient.getLastLocation() and there is no location on device at this time. So you need to request location updates , like mFusedLocationClient.requestLocationUpdates. This links will be useful https://developer.android.com/training/location/receive-location-updates?hl=es and https://github.com/googlesamples/android-play-location

    0 讨论(0)
提交回复
热议问题