Unknown URL content://contacts

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Unknown URL content://contacts

Postby apoorva_iitm » Wed Jul 09, 2008 12:04 pm

Hi

When I run the following lines in my code, I get the error
java.lang.IllegalArgumentException: Unknown URL content://contacts

String[] PEOPLE_PROJECTION = new String[] {
Contacts.People._ID,
Contacts.People.NAME,
Contacts.People.NUMBER_KEY
};
____________________________________________________________

Cursor cursor = managedQuery(Contacts.CONTENT_URI,
PEOPLE_PROJECTION, null, null,
Contacts.People.DEFAULT_SORT_ORDER);
int name = cursor.getColumnIndex(Contacts.People.NAME);

Kindly help. When I remove the last line, I don't get the exception. But how can the URL mentioned there be unknown?
apoorva_iitm
Freshman
Freshman
 
Posts: 4
Joined: Sun Jul 06, 2008 12:06 pm

Top

Re: Unknown URL

Postby apoorva_iitm » Thu Jul 10, 2008 11:48 am

I got the solution to that problem. I needed to write PeopleColumns instead of People.

But now it's a new problem. I'm unable to insert contentvalues into my contentprovider. It gives the error Unknown URL: content://myapp/contacts when I use
Uri newPersonUri = getContentResolver().insert(
contents.Contacts.CONTENT_URI, c1);

Please help. Also, is there a way to see the contents of my contentprovider through adb?
apoorva_iitm
Freshman
Freshman
 
Posts: 4
Joined: Sun Jul 06, 2008 12:06 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Google [Bot] and 5 guests