Java Code Examples for android.content.ContentResolver#CURSOR_DIR_BASE_TYPE

The following examples show how to use android.content.ContentResolver#CURSOR_DIR_BASE_TYPE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskProvider.java    From opentasks with Apache License 2.0 6 votes vote down vote up
@Override
public String getType(Uri uri)
{
    switch (mUriMatcher.match(uri))
    {
        case LISTS:
            return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + TaskLists.CONTENT_URI_PATH;
        case LIST_ID:
            return ContentResolver.CURSOR_ITEM_BASE_TYPE + "/org.dmfs.tasks." + TaskLists.CONTENT_URI_PATH;
        case TASKS:
            return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + Tasks.CONTENT_URI_PATH;
        case TASK_ID:
            return ContentResolver.CURSOR_ITEM_BASE_TYPE + "/org.dmfs.tasks." + Tasks.CONTENT_URI_PATH;
        case INSTANCES:
            return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + Instances.CONTENT_URI_PATH;
        case INSTANCE_ID:
            return ContentResolver.CURSOR_ITEM_BASE_TYPE + "/org.dmfs.tasks." + Instances.CONTENT_URI_PATH;
        default:
            throw new IllegalArgumentException("Unsupported URI: " + uri);
    }
}
 
Example 2
Source File: TaskProvider.java    From opentasks-provider with Apache License 2.0 6 votes vote down vote up
@Override
public String getType(Uri uri)
{
	switch (mUriMatcher.match(uri))
	{
		case LISTS:
			return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + TaskLists.CONTENT_URI_PATH;
		case LIST_ID:
			return ContentResolver.CURSOR_ITEM_BASE_TYPE + "/org.dmfs.tasks." + TaskLists.CONTENT_URI_PATH;
		case TASKS:
			return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + Tasks.CONTENT_URI_PATH;
		case TASK_ID:
			return ContentResolver.CURSOR_ITEM_BASE_TYPE + "/org.dmfs.tasks." + Tasks.CONTENT_URI_PATH;
		case INSTANCES:
			return ContentResolver.CURSOR_DIR_BASE_TYPE + "/org.dmfs.tasks." + Instances.CONTENT_URI_PATH;
		default:
			throw new IllegalArgumentException("Unsupported URI: " + uri);
	}
}
 
Example 3
Source File: BaseContentProvider.java    From droitatedDB with Apache License 2.0 5 votes vote down vote up
protected BaseContentProvider() {
	String authority = getAuthority();
	String base = getEntityURIPart();
	String typeDescription = "/vnd." + authority + "." + base;

	contentUri = PROTOCOL + authority + "/" + base;
	dirContentType = ContentResolver.CURSOR_DIR_BASE_TYPE + typeDescription;
	itemContentType = ContentResolver.CURSOR_ITEM_BASE_TYPE + typeDescription;

	uriMatcher.addURI(authority, base, MATCH_DIR);
	uriMatcher.addURI(authority, base + "/#", MATCH_ITEM);

	REGISTRY.add(getTableName(), contentUri);
}
 
Example 4
Source File: SQLiteMatcherEntry.java    From android-atleap with Apache License 2.0 5 votes vote down vote up
public String getType() {
    if (this.equals(ITEM)) {
        return ContentResolver.CURSOR_ITEM_BASE_TYPE;
    } else if (this.equals(DIR)) {
        return ContentResolver.CURSOR_DIR_BASE_TYPE;
    }
    return null;
}