There is distinct recomendation in documentation for defining all uris while implementing ContentProvider. But I'm confused with URI matcher part: for example, I've got package org.company.example
, table named 'items', then I define
public static final Uri CONTENT_URI =
Uri.parse("content://org.company.example.sampleprovider/items");
And what authority part should I use for matching URIs in static init:
private static final UriMatcher uriMatcher;
static {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI("what goes here?", "items", ITEM);
uriMatcher.addURI("what goes here?", "items/#", ITEM_ID);
}