I have make one app in which i am display data in custom gridview and its going well but problem is when i am scroll it and go to bottom and get back to top then all item position can change automatically.and some time it is not appear after scroll.here is my code i think some thing wrong with getView
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder viewholder;
// LayoutInflater inflator = activit.getLayoutInflater();
if(convertView == null) { // recycled view is null so create it.
viewholder = new ViewHolder();
convertView = inflator.inflate(R.layout.gridviewrow, null);
viewholder.imgvGridItem = (RelativeLayout) convertView
.findViewById(R.id.rlGreidItemicon);
viewholder.txtGridItemlabel = (TextView) convertView
.findViewById(R.id.txtGridItemlabel);
if ((lstpinfo.get(position).appname.toString()) != null) {
viewholder.imgvGridItem.addView(getimageviewimage(lstpinfo
.get(position).icon));
viewholder.txtGridItemlabel
.setText(lstpinfo.get(position).appname.toString());
}
}
return convertView;
}
looks convert view logic is not implemented fully.
when you scroll, you get the not null convertView at that time you need to set new data in that and you are doing nothing in that case…….
+ you are not setting the ViewHolder in tag to get back it from convertView and use that.