Android Programming: ListView CheckBox gone visible -
i creating listview checkbox visibility:gone. want view checkboxes when long press item of items not display checkbox , changes when scroll. want make same way messagin app can delete multiple items selecting multiple checkboxes.
lists[0].setlongclickable(true); lists[0].setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { checkbox selectall = (checkbox) findviewbyid(r.id.selectall); selectall.setvisibility(view.visible); int count = lists[0].getchildcount(); int adapter = myadapter[0].getcount(); toast.maketext(getbasecontext(), integer.tostring(adapter), toast.length_long).show(); (int = 0; < adapter; i++) { view v = (view) lists[0].getitematposition(i); checkbox box = (checkbox) v.findviewbyid(r.id.checkboxselect); box.setvisibility(view.visible); } return true; } }); myadapter[0].notifydatasetchanged(); lists[0].setadapter(myadapter[0]);
Comments
Post a Comment