package net.micode.notes.ui;

import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.database.Cursor;

public class BackgroundQueryHandler extends AsyncQueryHandler {
    public interface QueryCompleteListener {
        void onQueryComplete(int token, Object cookie, Cursor cursor);
    }

    private QueryCompleteListener listener;

    public BackgroundQueryHandler(ContentResolver contentResolver) {
        super(contentResolver);
    }

    public void setQueryCompleteListener(QueryCompleteListener listener) {
        this.listener = listener;
    }

    @Override
    protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
        if (listener != null) {
            listener.onQueryComplete(token, cookie, cursor);
        }
    }
} 