我有一个contact
JsonArray
在 json 文件内。这是结构
"contact": [
{
"ref": [
1
],
"corresponding": true,
"name": "XYZ"
},
{
"ref": [
1
],
"name": "ZXY"
},
{
"ref": [
1
],
"name": "ABC"
},
{
"ref": [
1,
2
],
"name":"BCA"
}
]
现在,我有一个像这样的 4 个联系人数组,它有多个名称。我想存储所有 name
在 ArrayList 中显示 customListview
.
现在我的问题是
1)存储此数据和检索数据的推荐方法是什么?
2) 如何只存储 name
在 ArrayList<JsonObject>
?
3)我的第二选择是一个好的或推荐的方法吗??
最佳答案
我建议使用 java bean Contact
和 ArrayList<Contact>
关于java - 将 jsonobject 存储在 ArrayList 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17647225/