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