-2

Possible Duplicate:
Android ListView with delete button
android Listview button

Okay .. I will be simple and straight.. Please tell me how to add button in a list view. I have gone through various questions about this topic but none seems to help.

I have json format of data and am using hashmaps to read the values in the listviews.

1
  • Please stop asking the same question repeatedly. You could have just edited your original question (which would have put it back on the front page). Commented Nov 22, 2011 at 11:20

1 Answer 1

1

if you want to add button in a listview you need two layout one layout is a listview and second layout is showing button which you want and with the help of this code you can show listview with buttons.

LayoutInflater inflater = this.getLayoutInflater();
        LinearLayout listFooterView = (LinearLayout)inflater.inflate(
                com.demo.list.R.layout.footerview, null);

        LinearLayout listHeaderView = (LinearLayout)inflater.inflate(
                com.demo.list.R.layout.headerview, null);
        ListView lv = getListView();
        lv.setTextFilterEnabled(false);
        lv.addFooterView(listFooterView);
        lv.addHeaderView(listHeaderView);

here headerview and footerview is different layout in which i am showing buttons with listview.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot .. atleast u r better of those people who marking my post -vely :D

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.