Code example for ContentResolver

Methods: query

0
        Uri uri = createTaskEvent(task, cr, cv, false);
        task.setValue(Task.CALENDAR_URI, uri.toString());
    } 
 
    private static String getCalendarId(Uri uri, ContentResolver cr) {
        Cursor calendar = cr.query(uri, new String[] { CALENDAR_ID_COLUMN }, null, null, null);
        try { 
            calendar.moveToFirst();
            return calendar.getString(0);
        } catch (CursorIndexOutOfBoundsException e) {
            return null; 
        } finally  { 
            calendar.close();
        } 
    } 
 
    @SuppressWarnings("nls") 
    public static boolean deleteTaskEvent(Task task) {
        boolean eventDeleted = false;
        String uri;
        if(task.containsNonNullValue(Task.CALENDAR_URI))