Skip to content

Instantly share code, notes, and snippets.

View luckcoolla's full-sized avatar

Kiryl Vashyla luckcoolla

View GitHub Profile
@Macrow
Macrow / gist:99e2be7208dd42d76c0be8556dc785b0
Created May 24, 2017 17:00
Android, RxJava and Retrofit: Wait for multiple network calls to finish
[url]https://newfivefour.com/android-rxjava-wait-for-network-calls-finish.html[/url]
Android, RxJava and Retrofit: Wait for multiple network calls to finish
Say you have multiple network calls you need to make–cals to get Github user information and Github user events for example.
And you want to wait for each to return before updating the UI. RxJava can help you here.
Let’s first define our Retrofit object to access Github’s API, then setup two observables for the two network requests above: