Code example for UriMatcher

Methods: match

0
        return new ArrayListCursor(ADDRESS_BOOK_COLUMN_NAMES, results);
    } 
 
    @Override 
    public String getType(Uri url) {
        switch (URL_MATCHER.match(url)) {
            case ADN:
            case FDN:
            case SDN:
                return "vnd.android.cursor.dir/sim-contact"; 
 
            default: 
                throw new IllegalArgumentException("Unknown URL " + url);
        } 
    } 
 
    @Override 
    public Uri insert(Uri url, ContentValues initialValues) {
        Uri resultUri;
        int efType;
        String pin2 = null;