开发者

reload list contents on click of a button

i am trying to develop this app in an开发者_如何学Cdroid 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.


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


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜