Note that there are some explanatory texts on larger screens.

plurals
  1. POexpandablelistview with multiple textviews
    primarykey
    data
    text
    <p>I have an expandablelistview, that the parent has 4 textviews and the children, 4 textviews also.</p> <p>I know how can I populate if I have only 1 element on the parent and 1 on the child, but with 4 I don't.</p> <p>I think I must have all my data in separate arrayLists.</p> <pre><code> numerosServicios = new ArrayList&lt;String&gt;(); profesiones = new ArrayList&lt;String&gt;(); direcciones = new ArrayList&lt;String&gt;(); fechasCaduca = new ArrayList&lt;String&gt;(); tipos = new ArrayList&lt;String&gt;(); diasEnCurso = new ArrayList&lt;String&gt;(); fechasProximasCitas = new ArrayList&lt;String&gt;(); estados = new ArrayList&lt;String&gt;(); </code></pre> <p>But I don't know how I should make the adapter. I see this code but I don't understand it. </p> <p>Anyone has a example please? Thanks</p> <p><strong>EDIT</strong></p> <p>I found a "solution":</p> <pre><code> private List&lt;? extends List&lt;? extends Map&lt;String, ?&gt;&gt;&gt; creaListadeHijos() { ArrayList resultado_hijo = new ArrayList(); for(int i=0;i&lt;=ArrayServicios.size();i++){ HashMap hijo = new HashMap(); hijo.put("tipo", tipos.get(i)); hijo.put("diasEnCurso", diasEnCurso.get(i)); hijo.put("estado", estados.get(i)); hijo.put("fechaProCita", fechasProximasCitas.get(i)); resultado_hijo.add(hijo); } return (List)resultado_hijo; } private List&lt;? extends Map&lt;String, ?&gt;&gt; creaListaDeGrupos() { ArrayList resultado_padre = new ArrayList(); for(int i=0;i&lt;=ArrayServicios.size();i++){ HashMap padre = new HashMap(); padre.put("numero_servicio", numerosServicios.get(i)); padre.put("profesion", profesiones.get(i)); padre.put("direccion", direcciones.get(i)); padre.put("fecha_cad", fechasCaduca.get(i)); resultado_padre.add(padre); } return (List)resultado_padre; } SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter( contexto, creaListaDeGrupos(), R.layout.linea_padre, new String[] { "numero_servicio","profesion","direccion","fecha_cad" }, new int[] { R.id.tvServicio,R.id.tvProfesion,R.id.tvDireccion,R.id.tvDiasEnCurso}, creaListadeHijos(), R.layout.linea_hija, new String[] { "tipo", "diasEnCurso","estado","fechaProCita" }, new int[] { R.id.tvTipo , R.id.tvDiasEnCurso, R.id.tvEstado, R.id.tvFechaProximaCita} ); setListAdapter( expListAdapter ); registerForContextMenu(getExpandableListView()); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload