fusedlocationproviderclient - Why we have to remove location listener in FusedLocationProviderClient?
问题描述
I had a problem in which the location callback wasn't refreshing. So I added mFusedLocationProviderClient.removeLocationUpdates().
Why do we have to remove the location callback? Shouldn't It update itself whenever I move to a new location?
In the docs it stated this as:
This call will keep the Google Play services connection active, so make sure to call removeLocationUpdates(LocationCallback) when you no longer need it, otherwise you lose the benefits of the automatic connection management.
Can someone explain this?
解决方案
推荐阅读
- azure - Azure 数据工厂复杂 JSON 源(嵌套数组)到 Azure Sql 数据库?
- postgresql - 如果计数为 0,Postgres 会发出警告
- javascript - ERROR 错误:未捕获(在承诺中):TypeError:Promise.resolve 不是函数 TypeError:Promise.resolve 不是函数
- angular - 如何使用 jspdf 和 html2canvas 获取生成的 pdf 的文件大小(以字节为单位)
- reactjs - 在没有 redux-persist 或 localStorage 的情况下持久化数据
- xml - 计算每个贡献者段的总时间和元素 pc:chapter 的所有持续时间属性值的总和
- python - 在 np.where() 中有 & 的问题
- python - 本地主机上的私有 pypi 服务器
- xamarin.forms - 如何在平台标签上的 ToolbarItem 上绑定图像图标
- java - REST Assured 查询参数的多个值不起作用