Code example for AsyncQueryHandler

Methods: postDelayed, cancelOperation

0
            } 
        }, 10); 
    } 
     
    public static void startQueryForDraftboxView(AsyncQueryHandler handler, int token ,int mPostTime) {
        handler.cancelOperation(token);
        final int queryToken = token;
        final int postTime = mPostTime;
        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); 
            } 
        }, mPostTime);
    } 
     
    public static void startQueryForInboxView(AsyncQueryHandler handler, int token,String where) {
        handler.cancelOperation(token);