i_raqz
i_raqz

Reputation: 2959

reload list contents on click of a button

i am trying to develop this app in android that has 3-4 buttons and a list being displayed below them. each button when clicked must reload the list with new contents based on which button was clicked. each row in the list has a picture and two lines of text. could some one please suggest me how do I perform the reloading part.

Upvotes: 0

Views: 558

Answers (2)

viv
viv

Reputation: 6177

Attach the new adapter, with updated elements, with the listView, it will work as reloading the list view......

Upvotes: 1

jmccarthy
jmccarthy

Reputation: 114

You could grab the list, in whatever layout it is in (ex LinearLayout) by doing a:

LinearLayout ll = (LinearLayout)getViewById(R.id.thislayout)

Remove the elements from the list as you desire using:

ll.removeView(view);

edit the view object as you want (changing the source etc) then re-add it to the LinearLayout using:

ll.addView(view);

Upvotes: 0

Related Questions