Last active
August 8, 2020 10:30
-
-
Save manoj-mili/4e59665107a26bb7df140e0eed17ae6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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