Skip to content

Instantly share code, notes, and snippets.

@manoj-mili
Created August 8, 2020 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-mili/913960ab32112b33c6cf40eedeb6f4e0 to your computer and use it in GitHub Desktop.
Save manoj-mili/913960ab32112b33c6cf40eedeb6f4e0 to your computer and use it in GitHub Desktop.
public static final String URLEx = "https://jsonplaceholder.typicode.com/users/{user_id}/albums";
Rx2AndroidNetworking.get(URLEx).addPathParameter("user_id", "1").build().getJSONArraySingle().doOnSuccess(jsonArray -> {
//Handle once data is available
}).doOnError(throwable -> {
//Handle in case of Error
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment