【发布时间】:2017-07-11 06:41:24
【问题描述】:
常规的 Android(非 Fused)LocationListener
https://developer.android.com/reference/android/location/LocationListener.html
有onProviderEnabled和onProviderDisabled方法,
这样您就可以收听用户何时关闭/打开 GPS。在 Fused 版本中
https://developers.google.com/android/reference/com/google/android/gms/location/LocationListener
只有onLocationChanged。
我想知道如何确定我的用户在使用 Fused Location API 时何时打开/关闭 GPS/位置。
请注意,这与想要查询一次并接收布尔值是启用还是禁用位置不同;我需要一个有回调的监听器,以便在更改时采取行动。
非常感谢您的任何帮助。
【问题讨论】:
标签: java android locationlistener android-gps android-fusedlocation