why should i use android service instead of java thread

后端 未结 7 2057
遥遥无期
遥遥无期 2021-02-02 12:56

I am confused with android services and java thread.

Please help me to understand in which scenario i should use them.

As per my understanding

7条回答
  •  后悔当初
    2021-02-02 13:32

    Android Service don't run in a separate process (by default) and even don't run in a separate thread! It runs in the main thread(UI thread) of the application, therefore if you would like to do something time consuming task in the Service start a separate thread yourself, or use IntentService.

提交回复
热议问题