Skip to content

Instantly share code, notes, and snippets.

@miquelbeltran
Created September 24, 2016 09:34
Show Gist options
  • Save miquelbeltran/c9133976cad02bd960343cf427e3b01d to your computer and use it in GitHub Desktop.
Save miquelbeltran/c9133976cad02bd960343cf427e3b01d to your computer and use it in GitHub Desktop.
// Request API data on IO Scheduler
service.getWeather("Berlin", getString(R.string.api_key))
.subscribeOn(Schedulers.io())
// Read results in Android Main Thread (UI)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::display, this::processError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment