Code example for UriMatcher

Methods: match

0
        return c;
    } 
 
    @Override 
    public String getType(Uri uri) {
        switch (URI_MATCHER.match(uri)) {
            case CODE_ALL_POSTS:
            case CODE_POST:
                return CONTENT_TYPE;
            default: 
                throw new IllegalArgumentException("Unknown URI " + uri);
        } 
    } 
 
    @Override 
    public Uri insert(Uri uri, ContentValues initialValues) {
        if (URI_MATCHER.match(uri) != CODE_ALL_POSTS) {
            throw new IllegalArgumentException("Unknown URI " + uri);
        } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE