Question

I want to display a list item that says "More" at the end of my ListView. Clicking on this list-item will perform some action. How can I create this "more" list item?

Was it helpful?

Solution

Just add another value to your arrayadapter (or any other adapter), you might be using.set the text to 'more' . Suppose you have n items in the list then handle the (n+1)th postion click and do your stuff.

OTHER TIPS

I don't know about the "Clicking on this list-item will perform some action" part. The typical pattern is that once the user scrolls to the bottom, new material is loaded automatically. Some people do that by detecting the scroll. I do it by putting in a "More" placeholder and detecting when that is used. Here is a component that implements this pattern.

You can add a footer to your listview...

Did you check this post out?

Android ListView Footer View not being placed on the bottom of the screen

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top