I'm using a ListActivity
with an ArrayAdapter
. I have an array of String
s, and I want to put a divider after the 5th String
in the list. Is there any way to do this? Sorry if there are duplicates, just did not find what I was looking for. Thanks in advance.
There is a hack.
Add a divider view at last in your list_item's layout file and give it an Id. Now in your custom adapter class,you can set that view's visibility depending on the position whether you want it to be shown or not,in getView() method.