Android Service and UI Thread

后端 未结 2 837
情书的邮戳
情书的邮戳 2021-01-02 04:24

I have a Service running in my app..

This Service has an object for sending message to the server and a function to get that object and use it.

The object is

2条回答
  •  北海茫月
    2021-01-02 04:30

    As far I know, Android service run on UI thread. If you want to make an asynchronous job, you should use Intent Service
    See: What is the difference between an IntentService and a Service?
    Here is an Intent service example you can try.

提交回复
热议问题