ANR:Context.startForegroundService()然后未调用Service.startForeground(),InvisibleToUser

时间:2018-12-31 08:17:16

标签: android service

我正在我们的应用程序中获取此ANR。每当我调用startForegroundService()时,在onCreate()的开始处,我都会通过通知将服务提升为前台。

有什么办法可以避免这种ANR?这贡献了我们获得的ANR的90%。

I looked into this question but for them they are saying its causing a crash for them , while for us its an ANR

enter image description here

1 个答案:

答案 0 :(得分:0)

点击以下链接可查看android中的前台服务示例: Sample

Sample 2