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
g
gildor
12/20/2018, 11:33 PM
View inflation by default Is synchronous
k
kenkyee
12/21/2018, 12:33 PM
Unless you use the new async inflation API...AsyncLayoutInflater