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
  1. URI_MATCHER.addURI(Crowd.CROWD_AUTHORITY, "/Crowd", CUSTOMER);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


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. }
  4.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


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.
rocke
Freshman
Freshman
 
Posts: 6
Joined: Mon Jul 21, 2008 12:24 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests