我有这个JSON字符串:
[
{
"k":"number",
"v":"055 543 8679\n"
},
{
"k":"hours",
"v":"8:00AM - 9:00PM"
}
]
我正在尝试使用Gson进行解析:
val customFields = Gson().fromJson(food.customFields, ArrayList<CustomField>()::class.java)
但是以某种方式在断点模式下查看时,它被解析为LinkedTreeMap
答案 0 :(得分:-1)
尝试这个val customFields = new Gson().fromJson(food.customFields, CustomField.class);