i m getting response from server and inside response there is object and object contains another arrayofobjects and an individual object contains object (this object is sometimes returning me object and sometimes server is sending me false) so in case of false i m getting error RetrofitError:com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BOOLEAN at line 1 column 9774
how can i resolve this issue ?
public class NotificationResponse {
private UserNotificaions User_Notificaions;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
}
public class UserNotificaions {
private List<Record> records = new ArrayList<Record>();
private Pager pager;
private Integer nextPage;
private Integer prePage;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
}
public class Record{
private String name;
private String title;
private String profile_image;
private String id;
private String uid;
private String notification_type_id;
private String bid;
private String is_read;
private String total_notifications;
private BcastObj bcast_obj;
private User user_obj;
}
public class BcastObj {
private String bid;
private String name;
private String message;
private String tags;
}
public class User
{
private String total;
private String broadcast_comment_id;
private String bid;
}
SERVER response please take a look into "user_obj" and bcast_obj" in some conduitions server is sending me false in bcast_obj" while in some its not sending me bcast_obj" and only sending me user_obj so how to handle these two parts .... the major issue is once server is sending me false in user_obj
HERE is the " false " reciving in an object
{
"name": null,
"title": "NewBroadcastcreated",
"message": "abcihascreatednewbroadcast.",
"full_name": "abci",
"profile_thumb": "",
"profile_image": "",
"id": "C24-F5C8-DD24-4FF6-44978782082F",
"uid": "4E8A0-F3DD-C41D-4105-6443222CAB3C",
"notification_type_id": "2",
"is_created": "1420",
"sender_id": "F492B0-FB8C-8CD8-4C51-D77BEC987A78",
"type": "general",
"bid": "E1D-4426-B095-5F55-18A120F8C9D6",
"is_read": "1",
"is_notify_popup": "0",
"total_notifications": "937",
"bcast_obj": false
}