Articles → Android → Listview In Android
Listview In Android
Purpose
Example
Click to Enlarge
String fruitlist[] = {
"apple",
"banana",
"orange",
"cherry"
};
ListView listView = (ListView) findViewById(R.id.lview);
ArrayAdapter < String > adapter = new ArrayAdapter < String > (this, R.layout.support_simple_spinner_dropdown_item, fruitlist);
listView.setAdapter(adapter);
Output
Click to Enlarge