android - GridView loading images twice -
i'm trying create gallery loading instagram images specific tag. works pretty great except fact images duplicated.
my custom adapter looks this:
private class imageadapter extends baseadapter { private context mcontext; private arraylist<squareimagebutton> imagebuttons; public imageadapter(context c, arraylist<squareimagebutton> imagebuttons) { mcontext = c; this.imagebuttons = imagebuttons; } @override public int getcount() { return imagebuttons.size(); } @override public object getitem(int position) { return imagebuttons.get(position); } @override public long getitemid(int position) { return imagebuttons.get(position).getid(); } @override public view getview(int position, view convertview, viewgroup parent){ return imagebuttons.get(position); } public void adddata(arraylist<squareimagebutton> newbuttons){ imagebuttons.addall(newbuttons); notifydatasetchanged(); } }
i've tried redo getview method, because thats suggests in other peoples questions. can't seem figure out.
i've tried this:
@override public view getview(int position, view convertview, viewgroup parent){ squareimagebutton sib; if(convertview == null){ sib = imagebuttons.get(position); }else{ sib = (squareimagebutton)convertview; } return sib; }
but makes whole gridview weird floating images move on when scroll.
any suggestions appreciated.
Comments
Post a Comment