I need to show 3 fields of a table of a BD within a item in a Listview
, what I have so far is that it shows the data but in different items . Any ideas on how to include everything in a single item?
jsonArray = new JSONArray(result);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject preguntaDatos = null;
try {
preguntaDatos = jsonArray.getJSONObject(i);
} catch (JSONException e) {
e.printStackTrace();
}
String pregunta = null;
String respuesta= null;
String comentario=null;
try {
assert preguntaDatos != null;
pregunta = preguntaDatos.getString("pregunta");
respuesta = preguntaDatos.getString("respuesta");
comentario = preguntaDatos.getString("comentario");
} catch (JSONException e) {
e.printStackTrace();
}
preguntas.add(pregunta);
preguntas.add(respuesta);
preguntas.add(comentario);
}
expected result