本文整理匯總了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);
}