用Gson.fromJson()转换字符串list
为对应的ArrayList实例
return mGson.fromJson(list, new TypeToken<ArrayList<HomeServerConfig>>(){}.getType());
参考:
https://stackoverflow.com/questions/12384064/gson-convert-from-json-to-a-typed-arraylistt
用Gson.fromJson()转换字符串list
为对应的ArrayList实例
return mGson.fromJson(list, new TypeToken<ArrayList<HomeServerConfig>>(){}.getType());
参考:
https://stackoverflow.com/questions/12384064/gson-convert-from-json-to-a-typed-arraylistt
本文标题:使用Gson转换Json为ArrayList
本文链接:https://www.haomeiwen.com/subject/jidgzxtx.html
网友评论