Articles → Android → Listview In Android

Listview In Android






Purpose





Example




Picture showing the listview in the component tree
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


Picture showing the output of listview in android
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, November 15, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250