I am wanting to create a Spinner from an ArrayList of Objects I have created and therefore when one is selected I can go back to that ArrayList and get the rest of the information from it
Example
public class ObjectName {
private int ID;
private String name;
private String name2;
public ObjectName{int pID, String pName, String pName2) {
ID = pID;
name = pName;
name2 = pName2;
}
//Getters Here
}
Example of Spinner Code
ArrayList<ObjectName> objects = new ArrayList<ObjectName>;
ArrayAdapter<ObjectName> adapter = new ArrayAdapter<ObjectName>(this, android.R.layout.simple_spinner_item, objects);
Of course the Spinner does not show what I want. Is there an easy way to solve this
Thanks for your time