Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动服务后,再停止时会报如下错误 #20

Open
anshunwsl opened this issue Sep 25, 2019 · 4 comments
Open

启动服务后,再停止时会报如下错误 #20

anshunwsl opened this issue Sep 25, 2019 · 4 comments

Comments

@anshunwsl
Copy link

在启动过服务后,点击停止的时候会报这个错误, 楼主有啥好的解决办法没? 我直接运行项目中的 DEMO。
2019-09-25 13:36:23.008 13694-13694/com.aswsl.amap E/ActivityThread: Service com.aswsl.amap.rd03.MainWorkService has leaked ServiceConnection com.shihoo.daemon.work.AbsWorkService$1@8da07d3 that was originally bound here
android.app.ServiceConnectionLeaked: Service com.aswsl.amap.rd03.MainWorkService has leaked ServiceConnection com.shihoo.daemon.work.AbsWorkService$1@8da07d3 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.(LoadedApk.java:1614)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:1506)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1664)
at android.app.ContextImpl.bindService(ContextImpl.java:1617)
at android.content.ContextWrapper.bindService(ContextWrapper.java:698)
at com.shihoo.daemon.DaemonEnv.startServiceMayBind(DaemonEnv.java:41)
at com.shihoo.daemon.work.AbsWorkService.onStart(AbsWorkService.java:76)
at com.shihoo.daemon.work.AbsWorkService.onStartCommand(AbsWorkService.java:60)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3847)
at android.app.ActivityThread.access$2000(ActivityThread.java:215)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6933)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:937)

@anshunwsl
Copy link
Author

第一次点击启动服务 ,停止服务时可以正常停止
第二次点击启动服务,停止服务时, 就会报上面错误了。

@ShihooWang
Copy link
Owner

你好,
com.aswsl.amap.rd03.MainWorkService 这个是你自己的项目吧,请检查一下继承自AbsWorkService的一些函数是否正确使用。
示例Demo中可以随意的开启和关闭服务的。

@anshunwsl
Copy link
Author

示例DEMO是可以多次启动的, 问题出在我加了个高德地图API的定位代码, 楼主方便加个QQ吗?
请教下您一些问题, QQ: 397838921

@ShihooWang
Copy link
Owner

qq: 451082005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants