I'm trying to load data in asynchronously (and with coroutines) from an API in a fragment. I want to show a loading screen and initiate data loading. When the data is loaded, I want to switch the fragment to showing the real view and immediately apply the data. How can I do something like this? As I understand it, view inflation (from XML) is asynchronous, so how would I make sure the real view is done inflating before trying to apply the data? Right now, I have it working without a loading screen, but that means using
onViewCreated