We'll create a scrollable list of country names that are read from a string array. If we want to customize the layout, ListActivity knows which widget is the main list for the activity as long as we identify our ListView as let's work on real list example. If main view is just the list, we do not even need to supply a layout ListActivity will construct a full-screen list for us. The list items are automatically inserted to the list using a ListAdapter, and we use attached listener via setOnItemSelectedListener() to find out when the selection has changed.īut, if our activity is dominated by a single list, we might consider creating our activity as a subclass of ListActivity, rather than the regular Activity class. ListView is a ViewGroup that creates a list of scrollable items. Android provides the view ListView for this. The user gets a list of items that can be scrolled.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |