Android Custom ListView (Adding Images, sub-title)After creating simple ListView, android also provides facilities to customize our ListView. As the simple ListView, custom ListView also uses Adapter classes which added the content from data source (such as string array, array, database etc). Adapter bridges data between an AdapterViews and other Views Example of Custom ListViewIn this custom listview example, we are adding image, text with title and its sub-title. Structure of custom listview project ![]() activity_main.xmlCreate an activity_main.xml file in layout folder. File: activity_main.xml Create an additional mylist.xml file in layout folder which contains view components displayed in listview. mylist.xmlFile: mylist.xml Place the all required images in drawable folder. Activity classFile: MainActivity.java Customize Our ListViewCreate another java class MyListView.java which extends ArrayAdapter class. This class customizes our listview. MyListView.java Output ![]() ![]()
Next TopicAndroid Rating Bar Example
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week