URI_MATCHER doesn't work correctly

Put your problem here if it does not fit any of the other categories.

URI_MATCHER doesn't work correctly

Postby rocke » Wed Aug 20, 2008 11:44 pm

Hi Guys,

I've written my own ContentProvider, which works, except for the URI_MATCHER.
URI_MATCHER returns -1, when it should give me 1:

First, I add my URI, so that the matcher is able to recognize it:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
Parsed in 0.016 seconds, using GeSHi

At this point:
is Crowd.CROWD_AUTHORITY = "lan.tiptop.android.CrowdProvider"
and CUSTOMER = 1

At some points in the code it's necessary to check the uri:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. if (URI_MATCHER.match(uri) != CUSTOMER) {
  2.             throw new IllegalArgumentException("Unknown URI: " + uri);
  3. }
Parsed in 0.011 seconds, using GeSHi

The if-statement throws that exception:

"Unkown URI: content://lan.tiptop.android.CrowdProvider/Crowd"

I think the URI ist correct and URI_MATCHER should give me 1. :?:

Does anybody know, how to solve this?

P.S.: I use version 0.9 of the SDK.
Posts: 6
Joined: Mon Jul 21, 2008 12:24 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 8 guests