gson字符串转化为集合时报错,抛空指针异常,找不到原因

报错信息:Method threw 'java.lang.NullPointerException' exception. Cannot evaluate com.example.zhuli.hh_dangjian.QuestionCommentActivity$4.toString()

代码: List list_reply_beans =gson.fromJson(question.getList_str_comments(), new TypeToken>() {}.getType());

方法引发“java.lang.NullPointerException”异常。无法评估com.example.zhuli.hh_dangjian.QuestionCommentActivity$4.toString()。

列表LIST_REPLY_Beans=gson.fromJson(question.getList_str_comments(),newTypeToken>;(){}.getType();

方法如果没问题的话,估计是在执行的时候,传入的变量值为空导致的

调用toString的对象为null?

com.example.zhuli.hh_dangjian.QuestionCommentActivity$4.toString()这个明显的是你的Activity里面的4(内部类吧)错了,和gson没关系吧,debug到这行代码不就知道了