1
每次調用api時,數組鍵都會發生變化,因此如何製作宗地類。如何使用以下JSON數據創建Parcelable類?
{
"status": 200,
"message": "Ground Schedules",
"data": {
"Schedules": {
"2017-05-04": [
{
"id": "1216",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "02:00:00",
"end_time": "04:00:00",
"price": "100.00",
"is_available": "1"
},
{
"id": "1258",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "02:00:00",
"end_time": "04:00:00",
"price": "100.00",
"is_available": "1"
},
{
"id": "1259",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "04:00:00",
"end_time": "06:00:00",
"price": "100.00",
"is_available": "1"
},
{
"id": "1215",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "24:00:00",
"end_time": "02:00:00",
"price": "100.00",
"is_available": "1"
}
],
"2017-05-05": [
{
"id": "1266",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "03:00:00",
"end_time": "04:00:00",
"price": "100.00",
"is_available": "1"
}
],
"2017-05-06": [
{
"id": "1268",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "01:00:00",
"end_time": "02:00:00",
"price": "100.00",
"is_available": "1"
},
{
"id": "1267",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "24:00:00",
"end_time": "01:00:00",
"price": "100.00",
"is_available": "1"
}
]
},
"GroundBookedSlots": [
{
"id": "1120",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "17:00:00",
"end_time": "18:00:00",
"price": "500.00",
"date": "2017-04-19"
},
{
"id": "1112",
"ground_id": "100",
"ground_court_id": "71",
"start_time": "17:00:00",
"end_time": "18:00:00",
"price": "500.00",
"date": "2017-04-18"
}
]
}
}
謝謝,但我想創建Parcelable類這樣 公共類時刻表實現Parcelable {} – ckpatel
@ckpatel我知道''Parcelable。我可以知道爲什麼這需要這種情況? –
我已經在現有的應用程序和在這個使用parcelable類,所以我不知道這個 – ckpatel