在Activity.finish()与AsyncTask的还在后台运行,会发生什么? [英] What happens on Activity.finish() with AsyncTask still running in background?

查看:124
本文介绍了在Activity.finish()与AsyncTask的还在后台运行,会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用的AsyncTask仍在后台运行的Activity.finish(),会发生什么?

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

时它只是弹出活动关闭活动堆栈,但等待销毁活动的对象,直到AsyncTask的完全完成(因为AsyncTask的是一个内部类,我活动的)?

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)?

此外,将其行事的,如果AsyncTask的人认为没有举行提到了活动的实例?

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.

这篇关于在Activity.finish()与AsyncTask的还在后台运行,会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆