问题描述
反正是有知道一个片段
已完成加载片段
的全部内容?
Is there anyway to know that a Fragment
has finish loading the entire contents of the Fragment
?
我问的原因是因为在 onResume
状态,当我把应用程序在后台我重新加载片段
通过执行的AsyncTask
但我只想重新加载片段
被放在背景只有当片段
未完成加载布局的全部内容(图片,图形数据等)
The reason I'm asking is because in the onResume
state when I put the application in the background I Re-Load the Fragment
by executing an AsyncTask
but I only want to Re-Load the Fragment
that was put in the background only if the Fragment
has not finished loading the entire contents of the layout (images, shapes, data, etc...)
反正是有知道,如果片段
已满载?
is there anyway to know if the Fragment
has been fully loaded?
推荐答案
如果你刚刚想知道当你的片段布局完全充气ü可能需要使用 onActivityCreated(捆绑savedInstanceState)
是在的onCreate 和
onCreateView
。结果
你可以找到关于片段
生命周期的
If u just want to know when your Fragment layout is fully inflated u might want to use
onActivityCreated(Bundle savedInstanceState)
that is called after onCreate
and onCreateView
.
You can find more information about Fragment
life-cycle here
不管怎样,如果u想要更多准确的答案张贴一些您的code,并制作和例子来更好地描述你的目的。
Anyway, if u want more accurate answer post some of your code and make and example to better describe your purpose.
这篇关于Android的:如何知道一个片段已完成加载全部内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!