I've tried several ways to do this, I followed this -> Android Spinner databind using array list answer, but my object has an ArrayList inside.
The whole thing is an ArrayList where Object has a list on his own.
How can I show this information properly? Another field in this class is something I don't want to be selectable, just the arraylist inside. The class definition will make everything clear:
public class Horario{
private String fecha;
private ArrayList<String> hora;
public Horario(String _fecha, ArrayList<String> _hora){
fecha=_fecha;
hora = _hora;
}
public Horario(){}
public void setFecha(String _fecha){
fecha = _fecha;
}
public void setHora(ArrayList<String> _hora){
hora=_hora;
}
public String getFecha(){
return fecha;
}
public ArrayList<String> getHora(){
return hora;
}
}
This is a class for a schedule, the date (fecha) is what I dont want to be selectable, the hour (hora) is. I imagine this as a dropdown menu with categories (the date) and a group of clickable items (hours).
Date1
hour 1
hour 2
hour 3
Date2
hour 1
If this is difficult/impossible then I'm thinking of just listing the date + hour in each option of spinner.
Date1 - hour 1
Date1 - hour 2
Date1 - hour 3 ....
How can I achieve this? How can I personalize an adapter to get to this? Thanks in advance!