Skip to content

Instantly share code, notes, and snippets.

@manoj-mili
Last active August 8, 2020 10:30
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/4e59665107a26bb7df140e0eed17ae6d to your computer and use it in GitHub Desktop.
Save manoj-mili/4e59665107a26bb7df140e0eed17ae6d to your computer and use it in GitHub Desktop.
class User {
private String title;
private int id, userId;
}
//Mention the model class to which the data should be parsed if it is list or single just change
// the getType and same can be done for normal api requests
Rx2AndroidNetworking.get(URLEx).addPathParameter("user_id", "1").build().
getObjectListSingle(User.class).
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