I'm interested in fetching 3 JSONs from the server on the splash screen of my app, so the user doesn't sit and see a loading spinner.
Currently, I'm doing it like this:
MainActivity.raffle_controller.fetch_current_raffles(this);
startActivity(new Intent(this, MainActivity.class));
finish();
In the Controller, I'm populating an ArrayList on success from the JSON received. (using Volley)
But the request runs async, so my MainActivity loads with an empty screen.
After reloading the fragment though, everything from the controller is displayed.
I am curious if I can somehow wait for the list to be populate, then display the fragment.