When to use onCreateView () vs onActivityCreated ()?

1

I wanted to know the questions below:

- When to use onCreateView () vs onActivityCreated ()?

- Which of these two methods should I use to populate a listView with adapter?

    
asked by anonymous 19.10.2014 / 20:09

1 answer

0

onCreateView () is used when you want to create a custom Fragment . Caution, if you use it to create a view, you later need to destroy this object by calling onDestroyView () . It is always executed before onActivityCreated () .

OnActivityCreated () is called after the previous one informing you that a Fragment View was instantiated.

On what to use to populate a ListView, use onCreateView () because onActivityCreated () is more to retrieve the state of objects already created.

This last description did not test!

    
20.10.2014 / 00:48