Example usage for android.content AsyncQueryHandler startDelete

List of usage examples for android.content AsyncQueryHandler startDelete

Introduction

In this page you can find the example usage for android.content AsyncQueryHandler startDelete.

Prototype

public final void startDelete(int token, Object cookie, Uri uri, String selection, String[] selectionArgs) 

Source Link

Document

This method begins an asynchronous delete.

Usage

From source file:com.kku.apps.pricesearch.util.Utils.java

public static void deleteFavorites(Context context, ListItem item) {
    final AsyncQueryHandler dbHandler = new AsyncQueryHandler(context.getContentResolver()) {
    };/* w  w w  .j  av a 2  s  .co m*/
    dbHandler.startDelete(0, null, SearchContract.URI_FAVORITES, FavoritesColumns.ITEMURL + " = ?",
            new String[] { item.getItemUrl() });
}

From source file:org.jamienicol.episodes.ShowActivity.java

private void deleteShow() {
    final ContentResolver contentResolver = getContentResolver();
    final AsyncQueryHandler handler = new AsyncQueryHandler(contentResolver) {
    };//from  www .j  a  v  a 2s  .co m

    /* delete all the show's episodes */
    final String epSelection = String.format("%s=?", EpisodesTable.COLUMN_SHOW_ID);
    final String[] epSelectionArgs = { String.valueOf(showId) };

    handler.startDelete(0, null, ShowsProvider.CONTENT_URI_EPISODES, epSelection, epSelectionArgs);

    /* delete the show itself */
    final Uri showUri = Uri.withAppendedPath(ShowsProvider.CONTENT_URI_SHOWS, String.valueOf(showId));
    handler.startDelete(0, null, showUri, null, null);
}