Android: Create ListView in XML? Android: Create ListView in XML? xml xml

Android: Create ListView in XML?


I found the answer here: Android - creating listview entirely from xml

"You can use the android:entries attribute on your ListView element, pointing to a <string-array> resource (typically put in res/values/arrays.xml)."


here is the best example for your question.Custom list view


Use ListView tag & specify reqd attr to it. Then take one layout which will hold all the listview in it.Take another layout which will hold image set it's gravity to left. Take diff layout which will hold text set it's gravity to right & put all these in layout 1