IntentService will be killed after I stop my application

后端 未结 5 1099
栀梦
栀梦 2021-02-05 11:50

I am referring to android design considerations: AsyncTask vs Service (IntentService?)

According to the discussion, AsyncTask does not suit, because it is ti

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 12:28

    You are using startService(). The Service will run until it's code is done, or until Android decides it should be killed. Look up on bound services. On your Activity.onDestroy() you should call unbindService().

提交回复
热议问题