當前位置: 首頁>>代碼示例>>Java>>正文


Java AsyncQueryHandler.cancelOperation方法代碼示例

本文整理匯總了Java中android.content.AsyncQueryHandler.cancelOperation方法的典型用法代碼示例。如果您正苦於以下問題:Java AsyncQueryHandler.cancelOperation方法的具體用法?Java AsyncQueryHandler.cancelOperation怎麽用?Java AsyncQueryHandler.cancelOperation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.AsyncQueryHandler的用法示例。


在下文中一共展示了AsyncQueryHandler.cancelOperation方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startQueryHaveLockedMessages

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Check for locked messages in all threads or a specified thread.
 *
 * @param handler   An AsyncQueryHandler that will receive onQueryComplete
 *                  upon completion of looking for locked messages
 * @param threadIds A list of threads to search. null means all threads
 * @param token     The token that will be passed to onQueryComplete
 */
public static void startQueryHaveLockedMessages(AsyncQueryHandler handler,
                                                Collection<Long> threadIds,
                                                int token) {
    handler.cancelOperation(token);
    Uri uri = MmsSms.CONTENT_LOCKED_URI;

    String selection = null;
    if (threadIds != null) {
        StringBuilder buf = new StringBuilder();
        int i = 0;

        for (long threadId : threadIds) {
            if (i++ > 0) {
                buf.append(" OR ");
            }
            // We have to build the selection arg into the selection because deep down in
            // provider, the function buildUnionSubQuery takes selectionArgs, but ignores it.
            buf.append(Mms.THREAD_ID).append("=").append(Long.toString(threadId));
        }
        selection = buf.toString();
    }
    handler.startQuery(token, threadIds, uri,
            ALL_THREADS_PROJECTION, selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:moezbhatti,項目名稱:qksms,代碼行數:33,代碼來源:Conversation.java

示例2: startQueryHaveLockedMessages

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Check for locked messages in all threads or a specified thread.
 * @param handler An AsyncQueryHandler that will receive onQueryComplete
 *                upon completion of looking for locked messages
 * @param threadIds   A list of threads to search. null means all threads
 * @param token   The token that will be passed to onQueryComplete
 */
public static void startQueryHaveLockedMessages(AsyncQueryHandler handler,
        Collection<Long> threadIds,
        int token) {
    handler.cancelOperation(token);
    Uri uri = MmsSms.CONTENT_LOCKED_URI;

    String selection = null;
    if (threadIds != null) {
        StringBuilder buf = new StringBuilder();
        int i = 0;

        for (long threadId : threadIds) {
            if (i++ > 0) {
                buf.append(" OR ");
            }
            // We have to build the selection arg into the selection because deep down in
            // provider, the function buildUnionSubQuery takes selectionArgs, but ignores it.
            buf.append(Mms.THREAD_ID).append("=").append(Long.toString(threadId));
        }
        selection = buf.toString();
    }
    handler.startQuery(token, threadIds, uri,
            ALL_THREADS_PROJECTION, selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:slvn,項目名稱:android-aosp-mms,代碼行數:32,代碼來源:Conversation.java

示例3: startQueryForAll

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Start a query for all conversations in the database on the specified
 * AsyncQueryHandler.
 *
 * @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 startQueryForAll(AsyncQueryHandler handler, int token) {
    handler.cancelOperation(token);

    // This query looks like this in the log:
    // I/Database(  147): elapsedTime4Sql|/data/data/com.android.providers.telephony/databases/
    // mmssms.db|2.253 ms|SELECT _id, date, message_count, recipient_ids, snippet, snippet_cs,
    // read, error, has_attachment FROM threads ORDER BY  date DESC

    startQuery(handler, token, null);
}
 
開發者ID:moezbhatti,項目名稱:qksms,代碼行數:19,代碼來源:Conversation.java

示例4: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Start a query for in the database on the specified AsyncQueryHandler with the specified
 * "where" clause.
 *
 * @param handler   An AsyncQueryHandler that will receive onQueryComplete
 *                  upon completion of the query
 * @param token     The token that will be passed to onQueryComplete
 * @param selection A where clause (can be null) to select particular conv items.
 */
public static void startQuery(AsyncQueryHandler handler, int token, String selection) {
    handler.cancelOperation(token);

    // This query looks like this in the log:
    // I/Database(  147): elapsedTime4Sql|/data/data/com.android.providers.telephony/databases/
    // mmssms.db|2.253 ms|SELECT _id, date, message_count, recipient_ids, snippet, snippet_cs,
    // read, error, has_attachment FROM threads ORDER BY  date DESC

    handler.startQuery(token, null, sAllThreadsUri,
            ALL_THREADS_PROJECTION, selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:moezbhatti,項目名稱:qksms,代碼行數:21,代碼來源:Conversation.java

示例5: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
public static void startQuery(AsyncQueryHandler handler, int token, long threadId) {
    // cancel previous operations
    handler.cancelOperation(token);
    handler.startQuery(token, null,
            ContentUris.withAppendedId(Conversations.CONTENT_URI, threadId),
            MESSAGE_LIST_PROJECTION, null, null, Messages.DEFAULT_SORT_ORDER);
}
 
開發者ID:kontalk,項目名稱:androidclient,代碼行數:8,代碼來源:LegacyAbstractMessage.java

示例6: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
public static void startQuery(AsyncQueryHandler handler, int token, long threadId, long count, long lastId) {
    Uri.Builder builder = ContentUris.withAppendedId(Conversations.CONTENT_URI, threadId)
        .buildUpon()
        .appendQueryParameter("count", String.valueOf(count));
    if (lastId > 0) {
        builder.appendQueryParameter("last", String.valueOf(lastId));
    }

    // cancel previous operations
    handler.cancelOperation(token);
    handler.startQuery(token, lastId > 0 ? "append" : null, builder.build(),
            MESSAGE_LIST_PROJECTION, null, null, Messages.DEFAULT_SORT_ORDER);
}
 
開發者ID:kontalk,項目名稱:androidclient,代碼行數:14,代碼來源:CompositeMessage.java

示例7: startQueryForAll

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Start a query for all conversations in the database on the specified
 * AsyncQueryHandler.
 * 
 * @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 startQueryForAll(AsyncQueryHandler handler, int token) {
	handler.cancelOperation(token);

	// This query looks like this in the log:
	// I/Database( 147):
	// elapsedTime4Sql|/data/data/com.android.providers.telephony/databases/
	// mmssms.db|2.253 ms|SELECT _id, date, message_count, recipient_ids,
	// snippet, snippet_cs,
	// read, error, has_attachment FROM threads ORDER BY date DESC

	startQuery(handler, token, null);
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:23,代碼來源:Conversation.java

示例8: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Start a query for in the database on the specified AsyncQueryHandler with
 * the specified "where" clause.
 * 
 * @param handler
 *            An AsyncQueryHandler that will receive onQueryComplete upon
 *            completion of the query
 * @param token
 *            The token that will be passed to onQueryComplete
 * @param selection
 *            A where clause (can be null) to select particular conv items.
 */
public static void startQuery(AsyncQueryHandler handler, int token,
		String selection) {
	handler.cancelOperation(token);

	// This query looks like this in the log:
	// I/Database( 147):
	// elapsedTime4Sql|/data/data/com.android.providers.telephony/databases/
	// mmssms.db|2.253 ms|SELECT _id, date, message_count, recipient_ids,
	// snippet, snippet_cs,
	// read, error, has_attachment FROM threads ORDER BY date DESC

	handler.startQuery(token, null, sAllThreadsUri, ALL_THREADS_PROJECTION,
			selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:27,代碼來源:Conversation.java

示例9: startQueryHaveLockedMessages

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Check for locked messages in all threads or a specified thread.
 * 
 * @param handler
 *            An AsyncQueryHandler that will receive onQueryComplete upon
 *            completion of looking for locked messages
 * @param threadIds
 *            A list of threads to search. null means all threads
 * @param token
 *            The token that will be passed to onQueryComplete
 */
public static void startQueryHaveLockedMessages(AsyncQueryHandler handler,
		Collection<Long> threadIds, int token) {
	handler.cancelOperation(token);
	Uri uri = MmsSms.CONTENT_LOCKED_URI;

	String selection = null;
	if (threadIds != null) {
		StringBuilder buf = new StringBuilder();
		int i = 0;

		for (long threadId : threadIds) {
			if (i++ > 0) {
				buf.append(" OR ");
			}
			// We have to build the selection arg into the selection because
			// deep down in
			// provider, the function buildUnionSubQuery takes
			// selectionArgs, but ignores it.
			buf.append(Mms.THREAD_ID).append("=")
					.append(Long.toString(threadId));
		}
		selection = buf.toString();
	}
	handler.startQuery(token, threadIds, uri, ALL_THREADS_PROJECTION,
			selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:38,代碼來源:Conversation.java

示例10: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Start a query for in the database on the specified AsyncQueryHandler with the specified
 * "where" clause.
 *
 * @param handler An AsyncQueryHandler that will receive onQueryComplete
 *                upon completion of the query
 * @param token   The token that will be passed to onQueryComplete
 * @param selection   A where clause (can be null) to select particular conv items.
 */
public static void startQuery(AsyncQueryHandler handler, int token, String selection) {
    handler.cancelOperation(token);

    // This query looks like this in the log:
    // I/Database(  147): elapsedTime4Sql|/data/data/com.android.providers.telephony/databases/
    // mmssms.db|2.253 ms|SELECT _id, date, message_count, recipient_ids, snippet, snippet_cs,
    // read, error, has_attachment FROM threads ORDER BY  date DESC

    handler.startQuery(token, null, sAllThreadsUri,
            ALL_THREADS_PROJECTION, selection, null, Conversations.DEFAULT_SORT_ORDER);
}
 
開發者ID:slvn,項目名稱:android-aosp-mms,代碼行數:21,代碼來源:Conversation.java

示例11: startQuery

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
public static void startQuery(AsyncQueryHandler handler, int token) {
    // cancel previous operations
    handler.cancelOperation(token);
    handler.startQuery(token, null, Threads.CONTENT_URI,
            ALL_THREADS_PROJECTION, null, null, Threads.DEFAULT_SORT_ORDER);
}
 
開發者ID:kontalk,項目名稱:androidclient,代碼行數:7,代碼來源:Conversation.java


注:本文中的android.content.AsyncQueryHandler.cancelOperation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。