用Gson.fromJson()转换字符串list
为对应的ArrayList实例
1
return mGson.fromJson(list, new TypeToken<ArrayList<HomeServerConfig>>(){}.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