gridview have images load crashing app
here code :
@override public view getview(final int i, view convertview, viewgroup viewgroup) { final viewholder holder; if (convertview == null) { convertview = inflater.inflate(r.layout.inflate_photo_upload, null); holder = new viewholder(); holder.imgqueue = (imageview) convertview.findviewbyid(r.id.imgqueue); holder.imgedit = (imageview) convertview.findviewbyid(r.id.imgedit); holder.qty = (edittext)convertview.findviewbyid(r.id.quantity); holder.ok = (button)convertview.findviewbyid(r.id.btn_ok); holder.imgedit.setvisibility(view.gone); holder.qty.setvisibility(view.gone); holder.ok.setvisibility(view.gone); holder.qty.addtextchangedlistener(new textwatcher() { @override public void beforetextchanged(charsequence s, int start, int count, int after) { } @override public void ontextchanged(charsequence s, int start, int before, int count) { } @override public void aftertextchanged(editable s) { // save text here data.get(i).qty= 1; } }); holder.ok.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { data.get(i).qty= 1; } }); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } //holder.imgqueue.settag(position); imageloader.displayimage("file://" + data.get(i).sdcardpath, holder.imgqueue, new simpleimageloadinglistener() { @override public void onloadingstarted(string imageuri, view view) { holder.imgqueue.setimageresource(r.drawable.no_media); super.onloadingstarted(imageuri, view); } }); if (isactionmultiplepick) { holder.imgedit.setselected(data.get(i).isseleted); holder.qty.setselected(data.get(i).isseleted); holder.ok.setselected(data.get(i).isseleted); log.d("position data", data.get(i).tostring()); log.d("position", string.valueof(i)); } return convertview; }
Comments
Post a Comment