Code example for AsyncQueryHandler

Methods: postDelayed, cancelOperation

0
     * @param handler An AsyncQueryHandler that will receive onQueryComplete 
     *                upon completion of the query 
     * @param token   The token that will be passed to onQueryComplete 
     */ 
    public static void startQueryForDraftboxView(AsyncQueryHandler handler, int token) {
        handler.cancelOperation(token);
        final int queryToken = token;
        final AsyncQueryHandler queryHandler = handler;
        Log.d(TAG,"startQueryForDraftboxView");
        queryHandler.postDelayed(new Runnable() {
            public void run() { 
                queryHandler.startQuery(
                        queryToken, null, DRAFTFOLDER_URI,
                        null, null, null, Conversations.DEFAULT_SORT_ORDER); 
            } 
        }, 10); 
    } 
     
    public static void startQueryForInboxView(AsyncQueryHandler handler, int token) {
        handler.cancelOperation(token);
        final int queryToken = token;