【发布时间】:2023-03-27 18:56:01
【问题描述】:
我一直致力于在我的 android 应用程序中使用 FusedLocationProviderApi,但是每当我按如下方式创建 GoogleApiClient 时:
mGoogleApiClient = new GoogleApiClient.Builder(context)
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
在我什至在客户端上调用 connect 之前,通知栏中的精细位置图标就会打开。我尝试使用包含活动和应用程序范围的上下文的上下文,都产生了相同的结果。
我的问题是,这似乎让手机保持唤醒状态,无缘无故浪费电池。据我所知,该文档没有提及任何关于此的内容。
【问题讨论】:
标签: android gps location google-api-client fusedlocationproviderapi