Android: How do I know if a fragment has finished loading all content?

Do I need to know that Fragment finished loading all the contents of Fragment ?

The reason I ask is because in onResume state, when I put the application in the background, I reload the Fragment executing AsyncTask , but I only want to reload the Fragment that was placed in the background only if the Fragment not finished loading the entire contents of the layout (images, shapes, data, etc.)

still know if the Fragment was fully loaded?

+4
source share
1 answer

If you just want to know when the Fragment layout is fully inflated, you can use onActivityCreated(Bundle savedInstanceState) , which is called after onCreate and onCreateView .
You can find more information on the Fragment life cycle here.

In any case, if you want a more accurate answer, send part of your code and make an example to better describe your purpose.

+6
source

All Articles