I use Navigation Tabs in my app. I have 3 fragments which load different data from Internet. I want to know the best place where to put the code that make the HTTP request, in onCreate
, onCreateView
or onActivityCreated
?
Usually, I put all the code (requesting data, populating adapter, inflating view...) in onCreateView
. I also saw many people doing it on Internet.
But this guide https://github.com/thecodepath/android_guides/wiki/Creating-and-Using-Fragments do things differently. So I want to be sure on what to do exactly.