Android 如何检查使用Google Play服务的Location API当前是否正在运行?
有没有办法知道location api服务是否正在运行。 如果没有运行,我需要重新启动定位服务Android 如何检查使用Google Play服务的Location API当前是否正在运行?,android,google-location-services,Android,Google Location Services,有没有办法知道location api服务是否正在运行。 如果没有运行,我需要重新启动定位服务 其目的是:当设备重新启动时,位置服务停止。当服务停止时,我需要再次启动它。您是如何集成位置api的?我是说你用过什么服务吗?如果可能,共享您的codeIntent intent=新意图(此,LocationService.class);pendingent=pendingent.getService(this,0,intent,pendingent.FLAG_UPDATE_CURRENT);Locat
其目的是:当设备重新启动时,位置服务停止。当服务停止时,我需要再次启动它。您是如何集成位置api的?我是说你用过什么服务吗?如果可能,共享您的codeIntent intent=新意图(此,LocationService.class);pendingent=pendingent.getService(this,0,intent,pendingent.FLAG_UPDATE_CURRENT);LocationServices.FusedLocationApi.RequestLocationUpdate(mgoogleAppClient、mlLocationRequest、PendingEvent);您是否在服务中执行此操作并定期调用它?不,我正在我的主要活动中使用它,更新的位置将传递给intent service,intent service将根据我的共享首选项更新当前位置。所以我可以随时使用它。我也在寻找这个问题的答案。你是如何集成位置api的?我是说你用过什么服务吗?如果可能,共享您的codeIntent intent=新意图(此,LocationService.class);pendingent=pendingent.getService(this,0,intent,pendingent.FLAG_UPDATE_CURRENT);LocationServices.FusedLocationApi.RequestLocationUpdate(mgoogleAppClient、mlLocationRequest、PendingEvent);您是否在服务中执行此操作并定期调用它?不,我正在我的主要活动中使用它,更新的位置将传递给intent service,intent service将根据我的共享首选项更新当前位置。这样我就可以随时使用它。我也在寻找这个问题的答案。