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