views:

52

answers:

1

I'm using a mixture of the "Efficient Adapter" and the EndlessAdapter from CommonsGuy, and sometime the holder in getView() is null.

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    ViewHolder holder;

    if (convertView == null) {
        convertView = inflater.inflate(R.layout.queue_item, null);

        holder = new ViewHolder();
        holder.text = (TextView) convertView.findViewById(R.id.queueItemText);
        holder.image = (ImageView) convertView.findViewById(R.id.queueItemImage);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    if (holder != null) {
        holder.text.setText(queueItems.get(position).getTitle().getName());
    } else {
        Log.e(context.getString(R.string.app_name), "holder is null for some reason ...");
    }

    return convertView;
}

I've put the rest of the code for both of my classes here, as it's rather large to paste inline.

Once the whole data set is loaded, scrolling up & down causes rows to disappear and re-appear too.

A: 

Make sure you are using the latest EndlessAdapter, as it was updated a few weeks ago as I recall.

If that does not help, and if you can give me a full project (not just a couple of classes) that replicates the problem, I can try to fix it. Please contact me via the cw-android Google Group, which is the primary home for support for EndlessAdapter and my other components.

CommonsWare
I'm using 0.2.1 from github.I'll have to create something that replicates the issue (unless you have a Lovefilm dev account that you can use the keys from :-)Give me a few days and I'll be in touch via the Google group.
Stuart Grimshaw
@Stuart Grimshaw: Since I've never heard of "Lovefilm", I'm guessing that I don't have a dev account... :-) I look forward to the sample project, so I can squash the bug.
CommonsWare
There are accounts you can use, but it requires me to enter my credit card details, which obviously I don't want to do :-)I'm trying to recreate the problem without using an external datasource.
Stuart Grimshaw