【发布时间】:2020-04-25 19:02:01
【问题描述】:
交换两个对象位置以便将它们的新顺序保存在数据库中的最简单方法是什么? 谢谢。
我的路径是: https://localapi.io/artists?userId=1
我有一个 JSON 对象列表。
[
{
"deviceId": "1eb5e6bb-d08b-4f3b-8d71-2b3aab6547c9",
"name": "MDQ",
"phone": "7738375513",
"id": 1,
"userId": 1
},
{
"deviceId": "2eb5e6bb-d08b-4f3b-8d71-2b3aab6547c9",
"name": "Prismatix",
"phone": "2244427841",
"id": 2,
"userId": 1
},
{
"deviceId": "3eb5e6bb-d08b-4f3b-8d71-2b3aab6547c9",
"name": "Anderson Paak",
"phone": "3246743463",
"id": 3,
"userId": 1
},
{
"deviceId": "7eb5e6bb-d08b-4f3b-8d71-2b3aab6547c9",
"name": "Snarky Puppy",
"phone": "7738375515",
"id": 7,
"userId": 1
}
]
字段“id”是识别艺术家的字段。
【问题讨论】:
标签: android json database retrofit