Android service with long living HttpConnection

谁说胖子不能爱 提交于 2020-01-13 06:38:15

问题


I am tring to develop a project that connects to 

a comet server with long living connections. i do this job in a service. But when android device goes to idle mode, the thread i started from service stops working and do not close connections or try a new connection.

is there any method that i should use for this stuff.


回答1:


Using PowerManager.WakeLock solved my problem. I know, it kills baterry usage but, i had to use a long living service.



来源:https://stackoverflow.com/questions/5505801/android-service-with-long-living-httpconnection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!