android - How to update Activity UI based on ListView item selection? -
i creating sample application containing activity
[having listview
, button
] in layout file. listview
custom containing [label/name , checkbox]. want write code change text of button
adapter class of listview
based on list item checkbox
check [t/f].
listview.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id) { // when clicked, show toast textview text applistofallapps selecteditems = (applistofallapps) parent.getitematposition(position); if (view != null) { checkbox checkbox = (checkbox) view.findviewbyid(r.id.checkbox1); selecteditems = (applistofallapps) checkbox.gettag(); //here selected item may text accordingly , using using button variable set text button.settext("whatever"); } } });
Comments
Post a Comment