Here you can find the source of deleteContentUri(Context ctx, Uri contentUri, String idColumn)
Parameter | Description |
---|---|
ctx | the context whose content resolver to use to lookup the URI |
contentUri | the content URI to delete all the items from |
idColumn | the column of the primary key for the URI |
private static void deleteContentUri(Context ctx, Uri contentUri, String idColumn)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.net.Uri; public class Main { /**/*from w w w . ja v a 2 s . co m*/ * Utility method for deleting all the elements from a given content URI. You have to provide the name of the primary key column. * @param ctx the context whose content resolver to use to lookup the URI * @param contentUri the content URI to delete all the items from * @param idColumn the column of the primary key for the URI */ private static void deleteContentUri(Context ctx, Uri contentUri, String idColumn) { ctx.getContentResolver().delete(contentUri, null, null); } }