Before I start, I know I'm using the deprecated API calls in the code to
manage the contacts and it is because I'm trying to extend an existing
library without having to make too many changes to it. I won't mind
changing it but there's too many things there and I'm just experimenting
with an idea and don't want to write a whole framework again.
So now coming to the question, I'm unable to update a contact however I can
create or delete contacts in the emulator. I'm actually getting an
illegalargumentexception: empty values message when I try to update. The
relevant code is below.
Uri uri = Uri.parse(fullUri);
ContentValues updateValues = new ContentValues();
// updateValues.put(Contacts.People.DISPLAY_NAME, value);
updateValues.put(Contacts.People.NAME, value);
contentResolver.update(uri, updateValues, null, null);
and below is my stack trace
12-30 00:45:05.819: RpcServer:101(2592):
java.lang.IllegalArgumentException: Empty values
12-30 00:45:05.819: RpcServer:101(2592): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170)
12-30 00:45:05.819: RpcServer:101(2592): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
12-30 00:45:05.819: RpcServer:101(2592): at
android.content.ContentProviderProxy.update(ContentProviderNative.java:507)
12-30 00:45:05.819: RpcServer:101(2592): at
android.content.ContentResolver.update(ContentResolver.java:990)
12-30 00:45:05.819: RpcServer:101(2592): at
com.fun.rpc.SimpleServer$ConnectionThread.run(SimpleServer.java:91)
Has anyone seen this problem before? I tried sending the ID as part of the
where clause, that didn't work either. Also if I try to update email
address using a similar option as above, there are no errors but the
contact's email address doesn't get updated. When I try to update the name
as shown above I get the error.
Any hints or ideas please? Please let me know if you need more info. Is
there any links to show how the contacts database is structured would be
great too.
Many Thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en