I have created this arraylist and with a switch case i am getting the values of the "delhi" arraylist. What i want to do is to create a Listview that will be populated with the items of the arraylist after a button is pressed. I was able to make the items appear on a textview but i cannot do it in a listview
public void onItemSelected(AdapterView<?> parentView, View
selectedItemView, int myPosition, long myID) {
ArrayList<String> delhi = new ArrayList<String>();
delhi.add("Virgin Atlantic – London Heathrow");
delhi.add("British Airways – London Heathrow");
String country = spinner.getSelectedItem().toString();
switch (country){
case "Delhi":
record = delhi.get(0);
//record1 = delhi.get(1);
break;
case "Hongkong":
//do something
break;
// etc,etc,etc
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});