@Override public int delete(@NonNull Uri uri,String where,String[] whereArgs){
  Helpers.validateSelection(where,APP_READABLE_COLUMNS_SET);
  SQLiteDatabase db=openHelper.getWritableDatabase();
  int count;
  int match=URI_MATCHER.match(uri);
switch (match) {
case MY_DOWNLOADS:
case MY_DOWNLOADS_ID:
case ALL_DOWNLOADS:
case ALL_DOWNLOADS_ID:
    SqlSelection selection=getWhereClause(uri,where,whereArgs,match);
  deleteRequestHeaders(db,selection.getSelection(),selection.getParameters());
count=db.delete(DownloadContract.Downloads.DOWNLOADS_TABLE_NAME,selection.getSelection(),selection.getParameters());
notifyDownloadStatusChanged();
break;
case BATCHES:
case BATCHES_ID:
SqlSelection batchSelection=getWhereClause(uri,where,whereArgs,match);
count=db.delete(DownloadContract.Batches.BATCHES_TABLE_NAME,batchSelection.getSelection(),batchSelection.getParameters());
notifyBatchesChanged();
break;
default :
LLog.d("deleting unknown/invalid URI: " + uri);
throw new UnsupportedOperationException("Cannot delete URI: " + uri);
}
notifyContentChanged(uri,match);
return count;
}

@ Override public int delete ( @ NonNull Uri uri , String where , String [ ] whereArgs ) { Helpers . validateSelection ( where , APP_READABLE_COLUMNS_SET ) ; SQLiteDatabase db = openHelper . getWritableDatabase ( ) ; int count ; int match = URI_MATCHER . match ( uri ) ; switch ( match ) { case MY_DOWNLOADS : case MY_DOWNLOADS_ID : case ALL_DOWNLOADS : case ALL_DOWNLOADS_ID : SqlSelection selection = getWhereClause ( uri , where , whereArgs , match ) ; deleteRequestHeaders ( db , selection . getSelection ( ) , selection . getParameters ( ) ) ; count = db . delete ( DownloadContract . Downloads . DOWNLOADS_TABLE_NAME , selection . getSelection ( ) , selection . getParameters ( ) ) ; notifyDownloadStatusChanged ( ) ; break ; case BATCHES : case BATCHES_ID : SqlSelection batchSelection = getWhereClause ( uri , where , whereArgs , match ) ; count = db . delete ( DownloadContract . Batches . BATCHES_TABLE_NAME , batchSelection . getSelection ( ) , batchSelection . getParameters ( ) ) ; notifyBatchesChanged ( ) ; break ; default : LLog . d ( "deleting unknown/invalid URI: " + uri ) ; throw new UnsupportedOperationException ( "Cannot delete URI: " + uri ) ; } notifyContentChanged ( uri , match ) ; return count ; }
deletes a row in the database
