开发者

Android: How to send back data from thread to service?

Hy!

I have a service from which a start a new thread. This new thread wil开发者_Python百科l communicate with a TCP server using socket. What is the best way to send the data received from TCP server back to the service? Handlers or something else?

Thanks in advance, kukukk


It has been a while since this thread was opened, but I guess people are still coming here.
I managed to achieve this using the following answer:
How to communicate a service with a running thread in Android

Good luck ya' all.


What is the best way to send the data received from TCP server back to the service?

Make the thread be an inner class of the service, then just call a method on the service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜