开发者

What happens on Activity.finish() with AsyncTask still running in background?

开发者 https://www.devze.com 2022-12-28 04:52 出处:网络
What happens on Activity.finish() with an AsyncTask still running in background? Does it just pop the Activity off the Activity Stack, but wait to destroy the Activity object until the AsyncTask full

What happens on Activity.finish() with an AsyncTask still running in background?

Does it just pop the Activity off the Activity Stack, but wait to destroy the Activity object until the AsyncTask fully completes (since the AsyncTask is an inner class of my Activity)?

Also, would it act any differently开发者_开发技巧 if the AsyncTask were a public, non-inner class that held no references to the instance of the Activity?


I've tried the same thing with the Thread, and my observation is it keeps running the thread.

0

精彩评论

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

关注公众号