Nested object loop

Keywords: java android api nested retrofit

Question: 

I've got a problem about how to realize this API in my app.

  [
  {
 "items": [
  {
   "id": 1,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 99,
    "quantity": 2,
    "userID": 20
  },
  {
  "id": 2,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 78,
    "quantity": 4,
    "userID": 20
  },
  {
    "id": 3,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 36,
    "quantity": 6,
    "userID": 20
  },
  {
 "id": 4,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 25,
    "quantity": 8,
    "userID": 20
  }

  ],
  "id": 20,
  "userID": "1",
  "userName": "name",
  "address": "address",
  "postcode": "postcode",
  "specialNotes": "specialnotes",
  "totalPrice": 33,
  "status": "1"
  },
  {
"items": [
  {
     "id": 2,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 55,
    "quantity": 3,
    "userID": 79
  },
  {
    "id": 18,
    "itemID": 2,
    "itemName": "Name",
    "itemPrice": 33,
    "quantity": 10,
    "userID": 79
  }
  ],
 "id": 79,
 "userID": "79",
 "userName": "name",
 "address": "address",
 "postcode": "postcode",
 "specialNotes": "specialnotes",
 "totalPrice": 55,
 "status": "1"
  }
  ]

I appreciate any advice about how to realize this in recycler view.

P.S. I need all items from each user. Example in recycler view:

userID = 79
userName = name
postcode = postcode

ITEMS:

itemName = Name
quantity = 10
itemPrice = price

itemName = Name
quantity = 10
itemPrice = price

----------------------------------------


userID = 20
userName = name
postcode = postcode

ITEMS:

itemName = Name
quantity = 10
itemPrice = price

itemName = Name
quantity = 10
itemPrice = price

itemName = Name
quantity = 10
itemPrice = price

itemName = Name
quantity = 10
itemPrice = price

itemName = Name
quantity = 10
itemPrice = price

I want to get a list. I saw tutorials where you can get 1 item, but I need when you can get all items which one in API

Answers: