If an activity is killed, does the AsyncTask live on?

后端 未结 6 1611
你的背包
你的背包 2021-02-18 15:05

I think I know the answer to this, but does an AsyncTask continue to live on once its calling Activity has been finish()ed?

    protected void onPr         


        
6条回答
  •  滥情空心
    2021-02-18 15:25

    Async Tasks have no effect of the Activity lifecycle or any configuration changes. They keep on running till onPostExecute() method has been called.

    One should use Services for long running operations instead.

提交回复
热议问题