convertView
is null
.
You will need to inflate your row XML and use that if convertView
is null - it only gets populated once there is something to recycle.
Something like this:
@Override
public View getView(int position, final View convertView, ViewGroup parent) {
View v = convertView;
if (v == null)
v = super.getView(position, convertView, parent);
final ImageView ii=(ImageView)v.findViewById(R.id.example_imagess);
swipy.setOffsetRight(convertDpToPixel(280f));
@Override
public void onMove(int position, float x) {
if(x>0) {
ii.setVisibility(v.VISIBLE);
v.setBackgroundColor(Color.BLUE);
}
else {
ii.setVisibility(v.INVISIBLE);
}
}
});
return v;
}
The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view