当前位置: 首页>>代码示例>>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;未经允许,请勿转载。