delete Content in Context By Id - Android android.content

Android examples for android.content:ContentUris

Description

delete Content in Context By Id

Demo Code


//package com.java2s;

import android.content.ContentUris;
import android.content.Context;

import android.net.Uri;

public class Main {
    public static int deleteById(Context context, Uri uri, long id) {
        return context.getContentResolver().delete(
                ContentUris.withAppendedId(uri, id), null, null);
    }/*www.ja va2s .co  m*/

    public static int delete(Context context, Uri uri, String where) {
        return context.getContentResolver().delete(uri, where, null);
    }
}

Related Tutorials