Android:使用Gson从json创建对象时返回null

时间:2016-01-01 07:10:57

标签: android json parsing gson datamodel

这是我试图解析为对象的json:

Julia

这些是我试图解析的类:

{
  "api_token": "93244c644f3bb8d35b933fafef9556a5",
  "data": [
    {
      "_id": "5685cd7cda50430406e428a6",
      "created_at": "2016-01-01T00:51:08.438Z",
      "updated_at": "2016-01-01T00:51:08.438Z",
      "description": "bbdbbcbcbndb",
      "title": "ndjfjccjjcjnd",
      "__v": 0,
      "student_accepted": false,
      "quiz_type": 0,
      "quiz_chat_id": [],
      "quiz_time": 0,
      "quiz_status": false,
      "ask_by": "5685c8cada50430406e428a5",
      "answer_by": null
    }
  ]
}

public class RecentModel { private String api_token; private List<QuestionModel> data; } public class QuestionModel { private String _id; private String created_at; private String updated_at; private String description; private String title; private int __v; private boolean student_accepted; private int quiz_type; private List<Integer> quiz_chat_id; private int quiz_time; private boolean quiz_status; private String ask_by; private String answer_by; private String image; private String path; private ArrayList<ChatModel> quiz_chat; } 返回null。 我以前做过,但这次我真的不知道我的问题在哪里!? 很高兴,如果有人帮忙。

0 个答案:

没有答案