I am using a listview in a layout with a size- not in full size of layout.
Below the layout there are components like button.
I need the layout to get extended when more number of listitems adds dynamically.
I have kept the listview and buttons in scrollview.
Is there any attribute or option to make listview of variable length
You should not have a listview inside a scrollview. Instead of having a listview you should add your items to a linearlayout, which will grow to accomodate the items and not enable the scrollbar within itself. This will solve your UI issue. You can set the onclickListeners in a for looop.
Update