【发布时间】:2018-04-06 16:54:07
【问题描述】:
这只发生在 Android Oreo 上。我正在使用播放服务 11.4.2。 我正在使用 GeofencingClient 和 addGeofences 方法将地理围栏注册到一个处理地理围栏转换的 IntentService 的 pendingIntent。 看起来播放服务发送的意图在某些情况下被操作系统阻止了。
系统记录以下内容:
Background start not allowed: service Intent { cmp=my.app.id/my.package.struct.GeofenceTransIntentService (has extras) } to my.app.id/my.package.struct.GeofenceTransIntentService from pid=-1 uid=10154 pkg=my.app.id
在以下情况下添加地理围栏后:
- 当我在设备启动后添加它时
- 当我在应用程序被刷卡后添加它时 在这两种情况下,应用程序实际上已经在后台运行(因为我能够运行添加地理围栏的代码),因为我会监听 PROVIDERS_CHANGED、BOOT_COMPLETED。
【问题讨论】:
-
你能告诉我们你正在使用的代码吗?
标签: android google-play-services android-geofence google-location-services