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


Java AsyncQueryHandler.startDelete方法代碼示例

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


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

示例1: deletetSelectedItems

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
protected void deletetSelectedItems() {
	// 構造刪除條件(where子句)
	long[] ids = getListView().getCheckedItemIds();
	if(ids == null)
		throw new NullPointerException("ids is null");
	if(ids.length == 0)
		return;
	StringBuilder sb = new StringBuilder();
	for(long id : ids)
		sb.append(id + ",");
	sb.deleteCharAt(sb.length() - 1);
	String selection = Contract.Messages._ID + " IN ( " + sb.toString() + " )";

	AsyncQueryHandler handler = new AsyncQueryHandler(
			getActivity().getContentResolver()) {
		@Override
		protected void onDeleteComplete(int token,
				Object cookie, int result) {
			mDeletehandlers.remove(this);
			if(mDeletehandlers.isEmpty())
				getActivity().setProgressBarIndeterminateVisibility(false);
			Toast.makeText(
					getActivity(),
					getString(R.string.prompt_delete_messages_successfully, result),
					Toast.LENGTH_LONG)
				.show();
		}
	};
	mDeletehandlers.add(handler);
	getActivity().setProgressBarIndeterminateVisibility(true);
	handler.startDelete(-1, null, Contract.Messages.MESSAGES_URI, selection, null);
}
 
開發者ID:chenbocong,項目名稱:FamilyLink,代碼行數:33,代碼來源:MessagesFragment.java

示例2: deleteGenres

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
protected static void deleteGenres(Context context, int movidId) {
    final AsyncQueryHandler handler = new AsyncCrudHandler(context.getContentResolver());
    handler.startDelete(3, null,
          MovieContract.MovieGenreEntry.CONTENT_URI,
          MovieContract.MovieGenreEntry.WHERE_MOVIE_ID,
          new String[] {""+movidId});
}
 
開發者ID:bdiegel,項目名稱:android-tmdb,代碼行數:8,代碼來源:MovieFavorites.java

示例3: removeFavorite

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
public static void removeFavorite(Context context, Movie movie) {
    Log.d(TAG, "Removing favorite: " + movie.getTitle());
    final AsyncQueryHandler handler = new AsyncCrudHandler(context.getContentResolver());
    handler.startDelete(2, null,
          MovieContract.MovieEntry.CONTENT_URI,
          MovieContract.MovieEntry.WHERE_MOVIE_ID,
          new String[]{"" + movie.getId()});
}
 
開發者ID:bdiegel,項目名稱:android-tmdb,代碼行數:9,代碼來源:MovieFavorites.java

示例4: deleteTeamMatch

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Delete a single team match from the database. This method is asynchronous.
 */
public static void deleteTeamMatch(Context ctx, long teamMatchId) {
  AsyncQueryHandler handler = new AsyncQueryHandler(ctx.getContentResolver()) {
  };
  handler.startDelete(-1, null, TeamMatches.CONTENT_URI, TeamMatches._ID + "=?",
      new String[] { "" + teamMatchId });
}
 
開發者ID:alexjlockwood,項目名稱:scouting-manager-2013,代碼行數:10,代碼來源:StorageUtil.java

示例5: asyncDeleteObsoleteThreads

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Remove any obsolete conversations sitting around on disk. Obsolete
 * threads are threads that aren't referenced by any message in the pdu or
 * sms tables.
 */
public static void asyncDeleteObsoleteThreads(AsyncQueryHandler handler,
		int token) {
	handler.startDelete(token, null, Threads.OBSOLETE_THREADS_URI, null,
			null);
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:11,代碼來源:Conversation.java

示例6: purgeAll

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
public static void purgeAll(Context ctx) {
  AsyncQueryHandler handler = new AsyncQueryHandler(ctx.getContentResolver()) {
  };
  handler.startDelete(-1, null, ScoutContract.BASE_URI, null, null);
}
 
開發者ID:alexjlockwood,項目名稱:scouting-manager-2013,代碼行數:6,代碼來源:StorageUtil.java

示例7: asyncDeleteObsoleteThreads

import android.content.AsyncQueryHandler; //導入方法依賴的package包/類
/**
 * Remove any obsolete conversations sitting around on disk. Obsolete threads are threads
 * that aren't referenced by any message in the pdu or sms tables.
 */
public static void asyncDeleteObsoleteThreads(AsyncQueryHandler handler, int token) {
    handler.startDelete(token, null, Threads.OBSOLETE_THREADS_URI, null, null);
}
 
開發者ID:moezbhatti,項目名稱:qksms,代碼行數:8,代碼來源:Conversation.java


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