views:

20

answers:

0

I have two Uris. Suppose they are:

content://myprovider/messages
content://myprovider/messages/#

In my extended ContentProvider I have declared the following:

    private static final int MESSAGES = 1;
    private static final int MESSAGES_ID = 2;

    private static final UriMatcher sUriMatcher;

    static {
        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        sUriMatcher.addURI("myprovider", "messages", MESSAGES);
        sUriMatcher.addURI("myprovider", "messages/#", MESSAGES_ID);
    }

When I use the...

content://myprovider/messages/#

...Uri when calling any ContentProvider method, say insert, and my ContentProvider method does a...

sUriMatcher.match(uri)

...and I get back 1 (MESSAGES).

Why???