Android的:如何知道一个片段已完成加载全部内容? [英] Android: How to know if a Fragment has finished loading entire content?

查看:161
本文介绍了Android的:如何知道一个片段已完成加载全部内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

反正是有知道一个片段已完成加载片段的全部内容?

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的:如何知道一个片段已完成加载全部内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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