本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}