Can't Read Rss Xml , With Simple Xml And Retrofit
I have searched a lot, but I can't assign my XML with My Classes and I take an Error from Retrofit when I am trying to Deserialize the XML. This is the XML that I call from my Int
Solution 1:
Eventually I changed my Callback and it Worked . I had to use the Model Class Rss in the Callback for example :
publicinterfaceApiService {
@GET("/?feed=single_gallery_feed")
void getGadgets(@Query("paged")int page, Callback<Rss> gadgetsCallback);
}
And the Callback inside MainActivity:
RestClientrestClient=newRestClient();
Callbackcallback=newCallback() {
@Overridepublicvoidsuccess(Object o, Response response) {
Categories_ = (Categories)o;
}
@Overridepublicvoidfailure(RetrofitError error) {
Toasttoast= Toast.makeText(getApplication(), "Something went wrong!!", Toast.LENGTH_SHORT);
toast.show();
}
};
restClient.getApiService().getCategories(callback);
Post a Comment for "Can't Read Rss Xml , With Simple Xml And Retrofit"