Code example for UriMatcher

Methods: match

0
    } 
 
    @Override 
    public String getType(Uri uri)
        { 
        switch (uriMatcher.match(uri))
            { 
            //---get directory--- 
            case DIR:
                return "vnd.android.cursor.dir/vnd.mozilla.dir "; 
            //---get a particular file--- 
            case FILE_NAME:
                return "vnd.android.cursor.item/vnd.mozilla.file "; 
            //---Unknown--- 
            default: 
                throw new IllegalArgumentException("Unsupported URI: " + uri);
            } 
    } 
 
    @Override 
    public Uri insert(Uri uri, ContentValues values) {