1
I wanted to know the questions below:
-When using onCreateView() vs onActivityCreated()?
-Which of these two methods should I use to fill a listview with Adapter?
1
I wanted to know the questions below:
-When using onCreateView() vs onActivityCreated()?
-Which of these two methods should I use to fill a listview with Adapter?
0
The onCreateView() is used when you want to create a Fragment custom. Beware, if you use it to create a view because later, you need to destroy this object by calling the onDestroyView(). It is always executed before the onActivityCreated().
The onActivityCreated() is called after the previous informing that a Fragment View has been instantiated.
About which to use to fill a Listview, use the onCreateView() for the onActivityCreated() is more to recover the state of objects already created.
That last description I did not test!
Browser other questions tagged android android-fragment
You are not signed in. Login or sign up in order to post.
Beware, the method
onDestroyView
is not to be called. He is already called byFragmentManager
during the destruction ofView
according to the life cycle ofFragment
.– Wakim