Code example for ContentResolver

Methods: delete

        Uri uri = null;
        try { 
            uri = resolver.insert(Images.Media.EXTERNAL_CONTENT_URI, values);
        } catch (Throwable th)  {
            // This can happen when the external volume is already mounted, but 
            // MediaScanner has not notify MediaProvider to add that volume. 
            // The picture is still safe and MediaScanner will find it and 
            // insert it into MediaProvider. The only problem is that the user 
            // cannot click the thumbnail to review the picture. 
            Log.e(TAG, "Failed to new image" + th);
        return uri;
    // This is the second step. It completes the partial data added by 
    // newImage. All columns other than DATE_TAKEN and DATA are inserted 
    // here. This method also save the image data into the file. 
    // Returns true if the update is successful. 
    public static boolean updateImage(ContentResolver resolver, Uri uri,