У меня есть ответ, который показан ниже. Я хочу напечатать значения массива из массива Quetions. Я могу напечатать только последнее значение.Пожалуйста, помогите ..
JSON
[
{
"id": 66,
"module_id": 1,
"module_name": "Medical",
"parent_id": 14,
"label": "Burns ",
"description": null,
"img_id": null,
"questions": [
{
"question": "Take a picture",
"input_type": "text",
"symptom_id": 66,
"question_id": 294,
"symptom_name": "Burns ",
"input_type_data": null
},
{
"question": "Give an accurate description of the accident",
"input_type": "text",
"symptom_id": 66,
"question_id": 295,
"symptom_name": "Burns ",
"input_type_data": null
},
{
"question": "What caused the burns?",
"input_type": "button",
"symptom_id": 66,
"question_id": 296,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Fire"
},
{
"text": "Scorching-metal"
},
{
"text": "Boiling-water"
},
{
"text": "Steams-or-vapours"
},
{
"text": "Sunbeams"
},
{
"text": "Other-agents"
}
]
},
{
"question": "How long did the exposure last?",
"input_type": "text",
"symptom_id": 66,
"question_id": 297,
"symptom_name": "Burns ",
"input_type_data": null
},
{
"question": "Did he inhale boiling gas or vapours?",
"input_type": "button",
"symptom_id": 66,
"question_id": 298,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Yes"
},
{
"text": "Noo"
}
]
},
{
"symptom_id": 66,
"question_id": 299,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Conscious"
},
{
"text": "Unconscious"
}
],
"question": "Was he conscious or unconscious?",
"input_type": "button"
},
{
"question": "Did the patient get any traumatism because\nof failing down?",
"input_type": "button",
"symptom_id": 66,
"question_id": 300,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Yes"
},
{
"text": "Noo"
}
]
},
{
"question": "Does he have a cough or breathing difficulties?",
"input_type": "button",
"symptom_id": 66,
"question_id": 301,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Yes"
},
{
"text": "Noo"
}
]
},
{
"question": "Does he have nausea or vomit?",
"input_type": "button",
"symptom_id": 66,
"question_id": 302,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Yes"
},
{
"text": "Noo"
}
]
},
{
"question": "Does he was like fainting?",
"input_type": "button",
"symptom_id": 66,
"question_id": 303,
"symptom_name": "Burns ",
"input_type_data": [
{
"text": "Yes"
},
{
"text": "Noo"
}
]
}
]
}
]
Моя логика
for (str in symptomsData!![position].questions!!)
{
var ans=str.question
holder.question.text = ans
}
Как мне сделать цикл, чтобы получить вопросы в textview.Я могу получить вопросымассив, но печать только последнего значения в textview. Я хочу напечатать все значения в textview