Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我使用 Google 地图并从 onLocationChanged() 获取纬度,而它在后台运行并使用服务获取该值。
因此,我的应用程序消耗了大量的电池电量
如何减少应用程序的功耗?
干得好:
用于setPriority(LocationRequest.PRIORITY_LOW_POWER);_LocationRequest
setPriority(LocationRequest.PRIORITY_LOW_POWER);
LocationRequest
请参阅此处的文档: