使用Gson转换Json为ArrayList

用Gson.fromJson()转换字符串list为对应的ArrayList实例

return mGson.fromJson(list, new TypeToken>(){}.getType());

参考:

https://stackoverflow.com/questions/12384064/gson-convert-from-json-to-a-typed-arraylistt

https://stackoverflow.com/questions/22271779/is-it-possible-to-use-gson-fromjson-to-get-arraylistarrayliststring

你可能感兴趣的:(使用Gson转换Json为ArrayList)