80,491
社区成员
发帖
与我相关
我的任务
分享
/**
* 将json格式转换成list对象
*
* @param jsonStr
* @return
*/
public static List<?> jsonToList(String jsonStr) {
List<?> objList = null;
if (gson != null) {
java.lang.reflect.Type type = new com.google.gson.reflect.TypeToken<List<?>>() {
}.getType();
objList = gson.fromJson(jsonStr, type);
}
return objList;
}



[/quote]
应该这样写吧:
Response.success(new JSONObject(json),HttpHeaderParser.parseCacheHeaders(response));[/quote]
Type mismatch: cannot convert from Response<JSONObject> to Response<T>,和上面的 Response<T>不匹配啊

[/quote]
应该这样写吧:
Response.success(new JSONObject(json),HttpHeaderParser.parseCacheHeaders(response));

