My app has a single activity which uses a TabLayout and 1 fragment for each tab's content. Some of these fragments have sub-tabs within and corresponding sub-fragments.
Each of these fragments rely on API calls to render their views. I want these fragments to make these API calls just once and render their views. If the user switches away to another tab and comes back, these fragments should just show the view they have already rendered the first time( there are some special conditions which trigger a fresh API call but those are rare and can be handled in onResume I think).
To achieve this, what is the best place to make the first API calls ? onCreateView ? or onStart or onResume or some other life cycle method ?