A Fragment
instance can persist through device configuration changes (like screen rotation). Because an Activity
will be destroyed and recreated when a configuration change happens, it's difficult to design one that will keep track of a thread or AsyncTask
. On the other hand, the system takes care of reattaching a persisted Fragment
to the proper Activity
at the other end (so to speak) of the configuration change. You would still be using a thread or AsyncTask
, only now the Fragment
is holding it instead.
There may be other uses for it, but there's the one I can think of.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…