I would simply extend BaseAdapter rather than Cursor Adapter and pass the fetched Data to the Adapter with a callback. Still you are not using any kind of different thread for the getThumbnail - the handler executes in the main thread and is only for updating the UI usually.
Also you should work with ViewHolders and the convertView to speed up the Grid-Speed.
I have something like this as BaseAdapter for every Adapter:
public abstract class MyBaseAdapter extends BaseAdapter {
protected LayoutInflater inflater;
protected Context context;
public TikBaseAdapter(Context context) {
this.context = context;
this.inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public final View getView(int position, View convertView, ViewGroup parent) {
int type = getItemViewType(position);
if (convertView == null) {
convertView = newView(type, parent);
}
bindView(position, type, convertView);
return convertView;
}
/** Create a new instance of a view for the specified {@code type}. */
public abstract View newView(int type, ViewGroup parent);
/** Bind the data for the specified {@code position} to the {@code view}. */
public abstract void bindView(int position, int type, View view);
}
My real Adapter overrides getItemViewType and then using switch-cases to inflate the correct layout - and work with viewHolders (view.setTag()) to speed up the scroll-performance. just use view.getTag() in the bindView method and then edit the View-Items.